* usr/bin/byobu-status:

- move tmux-specific width code into tmux case block
This commit is contained in:
Dustin Kirkland 2013-01-09 10:47:06 -06:00
commit bfbec44a5d
2 changed files with 17 additions and 17 deletions

3
debian/changelog vendored
View file

@ -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 <kirkland@ubuntu.com> Wed, 09 Jan 2013 09:49:47 -0600

View file

@ -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