From 16a7b47879b00dd77ca120b0fad6e9e43aec1d80 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 20 Aug 2011 11:33:47 -0700 Subject: [PATCH] * usr/bin/byobu-select-session: - check exist status of session listing --- debian/changelog | 2 ++ usr/bin/byobu-select-session | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0c7b27cc..927b3fd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Thu, 11 Aug 2011 10:31:31 -0500 diff --git a/usr/bin/byobu-select-session b/usr/bin/byobu-select-session index 8fe00fb7..2b671135 100755 --- a/usr/bin/byobu-select-session +++ b/usr/bin/byobu-select-session @@ -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])