* usr/bin/byobu-select-session:

- check exist status of session listing
This commit is contained in:
Dustin Kirkland 2011-08-20 11:33:47 -07:00
commit 16a7b47879
2 changed files with 8 additions and 6 deletions

2
debian/changelog vendored
View file

@ -79,6 +79,8 @@ byobu (4.30) unreleased; urgency=low
* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil,
usr/share/byobu/profiles/common, usr/bin/byobu:
- fix bold printing
* usr/bin/byobu-select-session:
- check exist status of session listing
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500

View file

@ -33,9 +33,9 @@ def get_sessions():
sessions = []
i = 0
if commands.getstatusoutput("command -v screen")[0] == 0:
output = commands.getoutput("screen -ls")
if output:
for s in output.split("\n"):
output = commands.getstatusoutput("screen -ls")
if output[0] == 0:
for s in output[1].split("\n"):
s = re.sub(r'\s+', ' ', s)
# Ignore hidden sessions (named sessions that start with a ".")
if (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0):
@ -44,9 +44,9 @@ def get_sessions():
sessions.append("screen____%s" % items[1])
i += 1
if commands.getstatusoutput("command -v tmux")[0] == 0:
output = commands.getoutput("tmux list-sessions")
if output:
for s in output.split("\n"):
output = commands.getstatusoutput("tmux list-sessions")
if output[0] == 0:
for s in output[1].split("\n"):
text.append("tmux: %s" % s.strip())
items = s.split(":")
sessions.append("tmux____%s" % items[0])