* usr/bin/byobu-status: LP: #997766

- handle status wider than terminal more gracefully
This commit is contained in:
Dustin Kirkland 2012-05-10 12:32:41 -07:00
commit 0618d5660b
2 changed files with 11 additions and 1 deletions

3
debian/changelog vendored
View file

@ -1,6 +1,7 @@
byobu (5.18) unreleased; urgency=low
* UNRELEASED
* usr/bin/byobu-status: LP: #997766
- handle status wider than terminal more gracefully
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 03 Apr 2012 19:22:04 -0500

View file

@ -35,6 +35,15 @@ for i in "${BYOBU_PREFIX}/share/$PKG/status/status" "${BYOBU_PREFIX}/share/$PKG/
[ -r "$i" ] && . "$i"
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
case "$BYOBU_BACKEND" in
screen)
# Reload profile, if necessary