mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
* usr/bin/byobu-status:
- move tmux-specific width code into tmux case block
This commit is contained in:
parent
2897016607
commit
bfbec44a5d
2 changed files with 17 additions and 17 deletions
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue