From f13586dc51015b8efb6b536386c49690dc30bcfe Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 28 Jan 2012 12:59:55 -0600 Subject: [PATCH] * usr/bin/byobu-select-session: LP: #911500 - detect and avoid some circular byobu-inside-byobu infinite loops --- debian/changelog | 2 ++ usr/bin/byobu-select-session | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac18980f..08fc6b48 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,6 +25,8 @@ byobu (5.6) unreleased; urgency=low * usr/bin/byobu, usr/bin/byobu-janitor, usr/lib/byobu/disk_io, usr/lib/byobu/include/constants: - use BYOBU_READLINK instead of READLINK + * usr/bin/byobu-select-session: LP: #911500 + - detect and avoid some circular byobu-inside-byobu infinite loops [ Ryan Thompson ] * usr/bin/byobu-select-session: LP: #919391 diff --git a/usr/bin/byobu-select-session b/usr/bin/byobu-select-session index e8742662..7b8ba6cb 100755 --- a/usr/bin/byobu-select-session +++ b/usr/bin/byobu-select-session @@ -117,6 +117,12 @@ if len(sessions) > 1: elif len(sessions) == 1: # Auto-select the only session choice = 1 + if BYOBU_BACKEND == "tmux" and os.getenv("TMUX"): + sys.stderr.write("ERROR: Sessions should be nested with care. Unset $TMUX to force.\n") + sys.exit(1) + elif BYOBU_BACKEND == "screen" and re.match("screen", os.getenv("TERM")): + sys.stderr.write("ERROR: Sessions should be nested with care. Remove 'screen' from $TERM to force.\n") + sys.exit(1) if choice: if sessions[choice-1] == "NEW":