diff --git a/debian/changelog b/debian/changelog index 0311f434..d34f918a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ byobu (5.20) unreleased; urgency=low - * UNRELEASED + * usr/bin/byobu-status: + - fix upgrades to the new width handling, where some things + were undefined -- Dustin Kirkland Fri, 08 Jun 2012 17:25:23 -0500 diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index 252a9155..54311e07 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -36,13 +36,17 @@ for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/ done # Fix status printing for small terminal sizes -w=$(tmux list-windows -F "#{session_width}") -read w_last < $BYOBU_RUN_DIR/width || w_last= -if [ "$w" != "$w_last" ]; then - tmux set -g status-left-length $((w*1/4)) >/dev/null 2>&1 - tmux set -g status-right-length $((w*3/4)) >/dev/null 2>&1 - printf "$w" > $BYOBU_RUN_DIR/width -fi +width=$(tmux list-windows -F "#{session_width}") +w_last=0 +[ -r "$BYOBU_RUN_DIR/width" ] && read w_last < $BYOBU_RUN_DIR/width 2>/dev/null 1>&2 || w_last=0 +for w in $width; do + if [ "$w" != "$w_last" ]; then + tmux set -g status-left-length $(($w*1/4)) >/dev/null 2>&1 + tmux set -g status-right-length $(($w*3/4)) >/dev/null 2>&1 + printf "$w" > $BYOBU_RUN_DIR/width + break + fi +done case "$BYOBU_BACKEND" in screen)