mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
must use CUSTOM_WINDOW_SET=1 to keep from reattaching to existing session
This commit is contained in:
parent
253bc12c8f
commit
9581f52e18
1 changed files with 9 additions and 5 deletions
|
@ -39,9 +39,10 @@ byobu-janitor --force
|
|||
printf "\033]0;${USER}@$(hostname) - ${PKG}\007"
|
||||
|
||||
# Allow override of default window list, with BYOBU_WINDOWS environment variable
|
||||
if [ ! -r "$BYOBU_WINDOWS" ]; then
|
||||
if [ -r "$BYOBU_WINDOWS" ]; then
|
||||
CUSTOM_WINDOW_SET=1
|
||||
else
|
||||
BYOBU_WINDOWS="$HOME/.$PKG/windows"
|
||||
DEFAULT_WINDOW_SET=1
|
||||
fi
|
||||
export BYOBU_WINDOWS
|
||||
|
||||
|
@ -58,15 +59,18 @@ if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ] && [ -w "$RUN" ]; then
|
|||
fi
|
||||
|
||||
# Now let's execute screen!
|
||||
if [ "$#" = "0" ] && [ "$DEFAULT_WINDOW_SET" = "1" ]; then
|
||||
if [ "$#" = "0" ]; then
|
||||
out=$(screen -wipe 2>/dev/null) || true
|
||||
if [ -r "$HOME/.nethackrc" ] || [ "$NETHACKOPTIONS" != "" ]; then
|
||||
NO_SOCKETS="^This room is empty "
|
||||
else
|
||||
NO_SOCKETS="^No Sockets found in "
|
||||
fi
|
||||
if echo "$out" | LANG=C grep -qsi "$NO_SOCKETS"; then
|
||||
# Start new session
|
||||
if [ "$CUSTOM_WINDOW_SET" = "1" ]; then
|
||||
# Start new custom window set session
|
||||
exec screen $SCREEN_TERM -c "/usr/share/$PKG/profiles/byoburc"
|
||||
elif echo "$out" | LANG=C grep -qsi "$NO_SOCKETS"; then
|
||||
# Start new default session
|
||||
exec screen $SCREEN_TERM -c "/usr/share/$PKG/profiles/byoburc" $DEFAULT_WINDOW
|
||||
else
|
||||
# Select and attach to an existing session
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue