* usr/bin/byobu-select-session:

- Handle `screen -ls' returning 1. (LP: #1098341)
This commit is contained in:
Dustin Kirkland 2013-01-10 16:35:24 -06:00
commit 03a0a59da5
2 changed files with 12 additions and 3 deletions

6
debian/changelog vendored
View file

@ -1,6 +1,8 @@
byobu (5.26) unreleased; urgency=low byobu (5.26) UNRELEASED; urgency=low
* UNRELEASED [ Iain Lane ]
* usr/bin/byobu-select-session:
- Handle `screen -ls' returning 1. (LP: #1098341)
-- Dustin Kirkland <kirkland@ubuntu.com> Wed, 09 Jan 2013 15:17:43 -0600 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 09 Jan 2013 15:17:43 -0600

View file

@ -41,7 +41,14 @@ def get_sessions():
sessions = [] sessions = []
i = 0 i = 0
if BYOBU_BACKEND == "screen": if BYOBU_BACKEND == "screen":
try:
output = subprocess.check_output(["screen", "-ls"]) output = subprocess.check_output(["screen", "-ls"])
except subprocess.CalledProcessError as cpe:
# screen -ls seems to always return 1
if cpe.returncode != 1:
raise
else:
output = cpe.output
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():