From 9b2814a68e0ab293482a91f8b51e51d4abe432c1 Mon Sep 17 00:00:00 2001 From: Pedro Romano Date: Sat, 31 May 2014 15:13:40 +0100 Subject: [PATCH] Support hidden names sessions with names start with a '_', adding in the process support for tmux hidden sessions whose names can't start with a '.'. --- usr/lib/byobu/include/select-session.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr/lib/byobu/include/select-session.py b/usr/lib/byobu/include/select-session.py index 88eb11fa..f06b7cba 100755 --- a/usr/lib/byobu/include/select-session.py +++ b/usr/lib/byobu/include/select-session.py @@ -57,8 +57,8 @@ def get_sessions(): if output: for s in output.splitlines(): s = re.sub(r'\s+', ' ', s) - # Ignore hidden sessions (named sessions that start with a ".") - if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0): + # Ignore hidden sessions (named sessions that start with a "." or a "_") + if s and s != " " and (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0 and s.count("._") == 0): text.append("screen: %s" % s.strip()) items = s.split(" ") sessions.append("screen____%s" % items[1]) @@ -71,7 +71,8 @@ def get_sessions(): output = output.decode(sys.stdout.encoding) if output: for s in output.splitlines(): - if s: + # Ignore hidden sessions (named sessions that start with a "_") + if s and not s.startswith("_"): text.append("tmux: %s" % s.strip()) sessions.append("tmux____%s" % s.split(":")[0]) i += 1