From bfbec44a5d39b096f6ceff2d579b14ba723c71ca Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 9 Jan 2013 10:47:06 -0600 Subject: [PATCH] * usr/bin/byobu-status: - move tmux-specific width code into tmux case block --- debian/changelog | 3 ++- usr/bin/byobu-status | 31 +++++++++++++++---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3ecae6c1..21e3ce31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ byobu (5.25) unreleased; urgency=low - * UNRELEASED + * usr/bin/byobu-status: + - move tmux-specific width code into tmux case block -- Dustin Kirkland Wed, 09 Jan 2013 09:49:47 -0600 diff --git a/usr/bin/byobu-status b/usr/bin/byobu-status index e43ab733..254e06a9 100755 --- a/usr/bin/byobu-status +++ b/usr/bin/byobu-status @@ -35,22 +35,6 @@ for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/ [ -r "$i" ] && . "$i" done -# Fix status printing for small terminal sizes -width=$(tmux list-windows -F "#{session_width}") -if [ -r "$BYOBU_RUN_DIR/width" ]; then - read w_last < $BYOBU_RUN_DIR/width 2>/dev/null 1>&2 -else - w_last=0 -fi -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) # Reload profile, if necessary @@ -62,6 +46,21 @@ case "$BYOBU_BACKEND" in fi ;; tmux) + # Fix status printing for small terminal sizes in tmux + width=$(tmux list-windows -F "#{session_width}") + if [ -r "$BYOBU_RUN_DIR/width" ]; then + read w_last < $BYOBU_RUN_DIR/width 2>/dev/null 1>&2 + else + w_last=0 + fi + 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 # Do first-run procedures, if necessary if [ -n "$TMUX" ]; then if [ ! -e "$BYOBU_RUN_DIR/${TMUX#*,}" ]; then