mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-22 22:34:23 -07:00
usr/bin/byobu-select-session: fix create-a-new-session on
select-session dialog, LP: #550808
This commit is contained in:
parent
81736c4854
commit
ee921559a1
2 changed files with 10 additions and 3 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -1,6 +1,8 @@
|
||||||
byobu (2.67) unreleased; urgency=low
|
byobu (2.67) unreleased; urgency=low
|
||||||
|
|
||||||
* Close LP: #528967, which was also fixed by the last upload
|
* Close LP: #528967, which was also fixed by the last upload
|
||||||
|
* usr/bin/byobu-select-session: fix create-a-new-session on
|
||||||
|
select-session dialog, LP: #550808
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 30 Mar 2010 00:56:18 -0500
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 30 Mar 2010 00:56:18 -0500
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
import commands, os, sys
|
import commands, os, sys
|
||||||
|
|
||||||
|
SHELL = os.getenv("SHELL", "/bin/bash")
|
||||||
sessions = []
|
sessions = []
|
||||||
choice = ""
|
choice = ""
|
||||||
sessions.append(0)
|
sessions.append(0)
|
||||||
|
@ -39,7 +40,7 @@ if i > 1:
|
||||||
for s in output.split("\n"):
|
for s in output.split("\n"):
|
||||||
sys.stdout.write(" %d. %s\n" % (i, s))
|
sys.stdout.write(" %d. %s\n" % (i, s))
|
||||||
i += 1
|
i += 1
|
||||||
sys.stdout.write(" %d. Create a new session\n" % i)
|
sys.stdout.write(" %d. Create a new session\n" % i)
|
||||||
i += 1
|
i += 1
|
||||||
try:
|
try:
|
||||||
choice = input("\nChoose 1-%d [1]: " % (i-1))
|
choice = input("\nChoose 1-%d [1]: " % (i-1))
|
||||||
|
@ -54,8 +55,12 @@ if i > 1:
|
||||||
sys.stderr.write("\nERROR: Invalid input\n");
|
sys.stderr.write("\nERROR: Invalid input\n");
|
||||||
|
|
||||||
if choice:
|
if choice:
|
||||||
# Attach to the chosen session
|
if choice == i-1:
|
||||||
os.execv("/usr/bin/byobu", ["", "-x", sessions[choice]])
|
# Create a new session
|
||||||
|
os.execv("/usr/bin/byobu", ["", SHELL])
|
||||||
|
else:
|
||||||
|
# Attach to the chosen session
|
||||||
|
os.execv("/usr/bin/byobu", ["", "-x", sessions[choice]])
|
||||||
else:
|
else:
|
||||||
# No valid selection, default to the youngest session
|
# No valid selection, default to the youngest session
|
||||||
os.execv("/usr/bin/byobu", ["", "-xRR"])
|
os.execv("/usr/bin/byobu", ["", "-xRR"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue