mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
* usr/bin/byobu-select-session:
- check exist status of session listing
This commit is contained in:
parent
1701c06fcb
commit
16a7b47879
2 changed files with 8 additions and 6 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -79,6 +79,8 @@ byobu (4.30) unreleased; urgency=low
|
||||||
* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil,
|
* usr/lib/byobu/ip_address, usr/lib/byobu/.shutil,
|
||||||
usr/share/byobu/profiles/common, usr/bin/byobu:
|
usr/share/byobu/profiles/common, usr/bin/byobu:
|
||||||
- fix bold printing
|
- 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
|
-- Dustin Kirkland <kirkland@ubuntu.com> Thu, 11 Aug 2011 10:31:31 -0500
|
||||||
|
|
||||||
|
|
|
@ -33,9 +33,9 @@ def get_sessions():
|
||||||
sessions = []
|
sessions = []
|
||||||
i = 0
|
i = 0
|
||||||
if commands.getstatusoutput("command -v screen")[0] == 0:
|
if commands.getstatusoutput("command -v screen")[0] == 0:
|
||||||
output = commands.getoutput("screen -ls")
|
output = commands.getstatusoutput("screen -ls")
|
||||||
if output:
|
if output[0] == 0:
|
||||||
for s in output.split("\n"):
|
for s in output[1].split("\n"):
|
||||||
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 ".")
|
||||||
if (s.find(" ") == 0 and len(s) > 1 and s.count("..") == 0):
|
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])
|
sessions.append("screen____%s" % items[1])
|
||||||
i += 1
|
i += 1
|
||||||
if commands.getstatusoutput("command -v tmux")[0] == 0:
|
if commands.getstatusoutput("command -v tmux")[0] == 0:
|
||||||
output = commands.getoutput("tmux list-sessions")
|
output = commands.getstatusoutput("tmux list-sessions")
|
||||||
if output:
|
if output[0] == 0:
|
||||||
for s in output.split("\n"):
|
for s in output[1].split("\n"):
|
||||||
text.append("tmux: %s" % s.strip())
|
text.append("tmux: %s" % s.strip())
|
||||||
items = s.split(":")
|
items = s.split(":")
|
||||||
sessions.append("tmux____%s" % items[0])
|
sessions.append("tmux____%s" % items[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue