* usr/bin/byobu:

- support detection of tmux sessions
This commit is contained in:
Dustin Kirkland 2011-10-07 12:21:14 -05:00
commit a56fc98563
2 changed files with 5 additions and 2 deletions

2
debian/changelog vendored
View file

@ -6,6 +6,8 @@ byobu (4.40) unreleased; urgency=low
* usr/lib/byobu/battery, usr/lib/byobu/cpu_freq, usr/lib/byobu/disk, * usr/lib/byobu/battery, usr/lib/byobu/cpu_freq, usr/lib/byobu/disk,
usr/lib/byobu/memory, usr/share/man/man1/byobu.1: usr/lib/byobu/memory, usr/share/man/man1/byobu.1:
- save a few characters on the status line - save a few characters on the status line
* usr/bin/byobu:
- support detection of tmux sessions
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 05 Oct 2011 18:05:32 -0400 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 05 Oct 2011 18:05:32 -0400

View file

@ -75,6 +75,7 @@ case $BYOBU_BACKEND in
# Use 256 colors, unless the user has overridden # Use 256 colors, unless the user has overridden
[ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2" [ -z "$SCREEN_TERM" ] && SCREEN_TERM="-2"
PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc" PROFILE="-f $BYOBU_PREFIX/share/$PKG/profiles/tmuxrc"
sessions=$($BYOBU_BACKEND list-sessions) || true
;; ;;
*) *)
# Allow override of default window list, with BYOBU_WINDOWS environment variable # Allow override of default window list, with BYOBU_WINDOWS environment variable
@ -110,17 +111,17 @@ case $BYOBU_BACKEND in
for i in "$@"; do for i in "$@"; do
case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac case $i in -*r*|-*d*|-*D*|-*S*|-ls|-list) NAME= ;; esac
done done
sessions=$($BYOBU_BACKEND -wipe 2>/dev/null) || true
;; ;;
esac esac
# Now let's execute the backend! # Now let's execute the backend!
if [ "$#" = "0" ]; then if [ "$#" = "0" ]; then
out=$($BYOBU_BACKEND -wipe 2>/dev/null) || true
if [ "$CUSTOM_WINDOW_SET" = "1" ]; then if [ "$CUSTOM_WINDOW_SET" = "1" ]; then
# Start new custom window set session # Start new custom window set session
exec $BYOBU_BACKEND $SCREEN_TERM $NAME $PROFILE exec $BYOBU_BACKEND $SCREEN_TERM $NAME $PROFILE
else else
case "$out" in case "$sessions" in
*\(*\)*) *\(*\)*)
# Select and attach to an existing session # Select and attach to an existing session
exec byobu-select-session exec byobu-select-session