mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 06:23:19 -07:00
usr/bin/byobu-launcher: don't disrupt work flow, but rather inform
user about launching byobu in a nested screen session, LP: #747649
This commit is contained in:
parent
816a3c1802
commit
14affd9b3a
2 changed files with 3 additions and 31 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -8,6 +8,8 @@ byobu (3.30) unreleased; urgency=low
|
|||
md driver's printing to /proc/mdstat, LP: #760693
|
||||
* usr/share/byobu/profiles/common: preserve splits across detach/reattach,
|
||||
LP: #760696
|
||||
* usr/bin/byobu-launcher: don't disrupt work flow, but rather inform
|
||||
user about launching byobu in a nested screen session, LP: #747649
|
||||
|
||||
[ Chaskiel Grundman ]
|
||||
* debian/postinst: correctly fix old-school screen-profiles era diversions
|
||||
|
|
|
@ -26,37 +26,7 @@ if [ ! -e "$DATA/disable-autolaunch" ]; then
|
|||
case "$TERM" in
|
||||
*screen*)
|
||||
# Handle nesting
|
||||
printf "$(gettext 'Do you want to launch byobu in a nested session?') [y/N]: "
|
||||
answer=$(head -n1)
|
||||
case "$answer" in
|
||||
y|Y)
|
||||
# Prevent nasty launch recursion, if ssh'ing to localhost
|
||||
if [ -n "$SSH_CONNECTION" ]; then
|
||||
# This is an SSH session
|
||||
from=$(echo "$SSH_CONNECTION" | awk '{print $1}')
|
||||
to=$(echo "$SSH_CONNECTION" | awk '{print $3}')
|
||||
if [ "$from" = "$to" ]; then
|
||||
# We have ssh'd from this machine, to this machine
|
||||
case "$(screen -ls)" in
|
||||
*\(Attached\)*)
|
||||
# And there is already an attached screen session, exit to prevent recursion
|
||||
false
|
||||
;;
|
||||
*)
|
||||
exec $BYOBU_PREFIX/bin/byobu "$@"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
exec $BYOBU_PREFIX/bin/byobu "$@"
|
||||
fi
|
||||
else
|
||||
exec $BYOBU_PREFIX/bin/byobu "$@"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
false
|
||||
;;
|
||||
esac
|
||||
printf "$(gettext 'To launch in a nested screen session, run: byobu')\n"
|
||||
;;
|
||||
dumb)
|
||||
# Dumb terminal, don't launch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue