From 1f76f1569be8254c3baa7cb49a5dd76f10e55991 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 31 Aug 2015 13:10:38 -0500 Subject: [PATCH] * usr/bin/byobu-launcher.in: LP: #1338260 - fix byobu autolaunch for TERM=screen-256color users --- debian/changelog | 3 ++- usr/bin/byobu-launcher.in | 16 ++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/debian/changelog b/debian/changelog index e784142a..766a30c1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ byobu (5.97) unreleased; urgency=medium - * UNRELEASED + * usr/bin/byobu-launcher.in: LP: #1338260 + - fix byobu autolaunch for TERM=screen-256color users -- Dustin Kirkland Mon, 31 Aug 2015 12:33:21 -0500 diff --git a/usr/bin/byobu-launcher.in b/usr/bin/byobu-launcher.in index 54b76a4d..3d171602 100755 --- a/usr/bin/byobu-launcher.in +++ b/usr/bin/byobu-launcher.in @@ -30,20 +30,12 @@ if [ -O "$HOME" ]; then case "$TERM" in *screen*) # Handle nesting - if [ -n "$LC_BYOBU" ] && [ "$LC_BYOBU" -gt 0 ]; then - # User explicitly wants nested sessions - if [ -n "$SSH_CONNECTION" ] && [ "$(printf "$SSH_CONNECTION" | awk '{print $1}')" != "$(printf "$SSH_CONNECTION" | awk '{print $3}')" ]; then - # Safeguard against ssh-ing into ourself, which causes an infinite loop - exec $BYOBU_PREFIX/bin/byobu "$@" - else - echo "INFO: Disabling auto-launch of Byobu in this SSH connection, to avoid a potential infinite loop" 1>&2 - echo "INFO: You can still run 'byobu' manually at the command line, if you know what you're doing" 1>&2 - true - fi + if [ -n "$SSH_CONNECTION" ] && [ "$(printf "$SSH_CONNECTION" | awk '{print $1}')" != "$(printf "$SSH_CONNECTION" | awk '{print $3}')" ]; then + # Safeguard against ssh-ing into ourself, which causes an infinite loop + exec $BYOBU_PREFIX/bin/byobu "$@" else - echo "INFO: Disabling auto-launch of Byobu in this nested session, to avoid a potential infinite loop" 1>&2 + echo "INFO: Disabling auto-launch of Byobu in this SSH connection, to avoid a potential infinite loop" 1>&2 echo "INFO: You can still run 'byobu' manually at the command line, if you know what you're doing" 1>&2 - echo "INFO: And you can set LC_BYOBU=1 in your environment to override this safeguard.\n" 1>&2 true fi ;;