* byobu-launcher:

- it seems that checking $STY is not totally sufficient for
      determining if we're already in a screen session; additionally
      check that TERM != screen-bce
    - set window title before we attach to an existing session
  * byobu:
    - test TERM against screen-bce here too
    - checking that $SHELL is executable covers -n too


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-08-28 11:02:03 -05:00
commit a881670fc8
3 changed files with 17 additions and 12 deletions

3
byobu
View file

@ -28,7 +28,7 @@ if [ "$1" = "-v" ]; then
fi fi
# Nesting byobu inside of screen doesn't work well # Nesting byobu inside of screen doesn't work well
if [ -n "$STY" ]; then if [ -n "$STY" ] || [ "$TERM" = "screen-bce" ]; then
echo `gettext "Exit the current screen session to run $PKG"` echo `gettext "Exit the current screen session to run $PKG"`
exit 1 exit 1
fi fi
@ -40,7 +40,6 @@ byobu-janitor --force
printf "\033]0;${USER}@$(hostname) - ${PKG}\007" printf "\033]0;${USER}@$(hostname) - ${PKG}\007"
# Launch motd+shell, unless the user has default windows set to launch # Launch motd+shell, unless the user has default windows set to launch
[ -n "$SHELL" ] || SHELL="/bin/sh"
[ -x "$SHELL" ] || SHELL="/bin/sh" [ -x "$SHELL" ] || SHELL="/bin/sh"
DEFAULT_WINDOW="$SHELL -c motd+shell" DEFAULT_WINDOW="$SHELL -c motd+shell"
grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW= grep -qs "^[^#]" "$HOME/.$PKG/windows" && DEFAULT_WINDOW=

View file

@ -18,17 +18,18 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
PKG="byobu"
# Make sure that we're not already in a screen session # Make sure that we're not already in a screen session
[ -z "$STY" ] || exit 0 [ -z "$STY" ] || exit 0
case "$TERM" in [ "$TERM" = "screen-bce" ] && exit 0
*screen*) exit 0 ;;
esac
out=`screen -ls 2>/dev/null` || true out=`screen -ls 2>/dev/null` || true
if echo "$out" | grep -qsi "^No Sockets found in "; then if echo "$out" | grep -qsi "^No Sockets found in "; then
# Start new byobu session # Start new session
exec byobu exec $PKG
else else
# Re-attach to an existing session # Set window title and re-attach to an existing session
printf "\033]0;${USER}@$(hostname) - ${PKG}\007"
exec screen -xRR exec screen -xRR
fi fi

13
debian/changelog vendored
View file

@ -1,10 +1,15 @@
byobu (2.30) unreleased; urgency=low byobu (2.30) unreleased; urgency=low
* byobu-launcher: make sure that we're not already in a screen session * byobu-launcher:
before launching or re-attaching byobu; it seems that $STY is not - it seems that checking $STY is not totally sufficient for
quite enough, must also check $TERM determining if we're already in a screen session; additionally
check that TERM != screen-bce
- set window title before we attach to an existing session
* byobu:
- test TERM against screen-bce here too
- checking that $SHELL is executable covers -n too
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 28 Aug 2009 10:53:03 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 28 Aug 2009 11:01:24 -0500
byobu (2.29-0ubuntu1) karmic; urgency=low byobu (2.29-0ubuntu1) karmic; urgency=low