[issue979] zshrc info_print appends annoying whitespace

Bernhard Tittelbach bts at bts.grml.org
Tue Apr 19 22:41:40 CEST 2011


New submission from Bernhard Tittelbach <xro at realraum.at>:

.zshrc's info_print concatenates strings and always appends a space at each
string. Consequently, there is one space too many at the end of the resulting
window or screen title.

In screen this additional space per windows eats up a lot of space on the
hardstatus line, when lot's of windows are in use.

the for loop in info_print should propably be replaced by a
printf '%s' "${(j: :)@}"
or a
printf '%s' "$*"
if that doesn't break anything else..

e.g.:
function info_print () {
     local esc_begin esc_end
     esc_begin="$1"
     esc_end="$2"
     shift 2
     printf '%s' ${esc_begin}
-    for item in "$@" ; do
-        printf '%s ' "$item"
-    done
+    printf '%s' "${(j: :)@}"
     printf '%s' "${esc_end}"

----------
assignedto: uli1
messages: 3731
nosy: btittelbach, uli1
priority: feature
status: unread
title: zshrc info_print appends annoying whitespace
topic: zsh

_____________________________________
GRML issue tracker <bts at bts.grml.org>
<http://bts.grml.org/grml/issue979>
_____________________________________


More information about the Bugs-changes mailing list