* usr/lib/byobu/include/select-session.py:

- This branch adds named sessions starting with an underscore also as
    hidden sessions in alternative to named sessions starting with a dot,
    since tmux doesn't support session names starting with a dot. In the
    process it also adds support for hidden session in tmux if the
    session names start with an underscore, adding this feature to tmux
    based byobu.
This commit is contained in:
Dustin Kirkland 2014-08-04 09:16:21 +02:00
commit bb6ea888ac
2 changed files with 12 additions and 4 deletions

9
debian/changelog vendored
View file

@ -1,6 +1,13 @@
byobu (5.85) unreleased; urgency=medium byobu (5.85) unreleased; urgency=medium
* UNRELEASED [ Pedro Romano ]
* usr/lib/byobu/include/select-session.py:
- This branch adds named sessions starting with an underscore also as
hidden sessions in alternative to named sessions starting with a dot,
since tmux doesn't support session names starting with a dot. In the
process it also adds support for hidden session in tmux if the
session names start with an underscore, adding this feature to tmux
based byobu.
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 28 Jul 2014 09:12:13 +0100 -- Dustin Kirkland <kirkland@ubuntu.com> Mon, 28 Jul 2014 09:12:13 +0100

View file

@ -57,8 +57,8 @@ def get_sessions():
if output: if output:
for s in output.splitlines(): for s in output.splitlines():
s = re.sub(r'\s+', ' ', s) s = re.sub(r'\s+', ' ', s)
# Ignore hidden sessions (named sessions that start with a ".") # 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): 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()) text.append("screen: %s" % s.strip())
items = s.split(" ") items = s.split(" ")
sessions.append("screen____%s" % items[1]) sessions.append("screen____%s" % items[1])
@ -71,7 +71,8 @@ def get_sessions():
output = output.decode(sys.stdout.encoding) output = output.decode(sys.stdout.encoding)
if output: if output:
for s in output.splitlines(): 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()) text.append("tmux: %s" % s.strip())
sessions.append("tmux____%s" % s.split(":")[0]) sessions.append("tmux____%s" % s.split(":")[0])
i += 1 i += 1