* 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
# 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"`
exit 1
fi
@ -40,7 +40,6 @@ byobu-janitor --force
printf "\033]0;${USER}@$(hostname) - ${PKG}\007"
# Launch motd+shell, unless the user has default windows set to launch
[ -n "$SHELL" ] || SHELL="/bin/sh"
[ -x "$SHELL" ] || SHELL="/bin/sh"
DEFAULT_WINDOW="$SHELL -c motd+shell"
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
# 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
[ -z "$STY" ] || exit 0
case "$TERM" in
*screen*) exit 0 ;;
esac
[ "$TERM" = "screen-bce" ] && exit 0
out=`screen -ls 2>/dev/null` || true
if echo "$out" | grep -qsi "^No Sockets found in "; then
# Start new byobu session
exec byobu
# Start new session
exec $PKG
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
fi

13
debian/changelog vendored
View file

@ -1,10 +1,15 @@
byobu (2.30) unreleased; urgency=low
* byobu-launcher: make sure that we're not already in a screen session
before launching or re-attaching byobu; it seems that $STY is not
quite enough, must also check $TERM
* 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
-- 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