* usr/lib/byobu/include/select-session.py:

- Fix cull_zombies() so that we properly cull zombies of sessions that
   have non-numeric session names
 - Allow the dynamic session-creation behaviour to be disabled by
   creating ~/.byobu/.reuse-session
This commit is contained in:
Dustin Kirkland 2018-03-15 14:27:54 -07:00
commit 12b0cc46c1
2 changed files with 14 additions and 2 deletions

7
debian/changelog vendored
View file

@ -4,6 +4,13 @@ byobu (5.125) unreleased; urgency=medium
* usr/share/byobu/profiles/dircolors: LP: #1752352
- fix blinking symlinks
[ Chow Loong Jin ]
* usr/lib/byobu/include/select-session.py:
- Fix cull_zombies() so that we properly cull zombies of sessions that
have non-numeric session names
- Allow the dynamic session-creation behaviour to be disabled by
creating ~/.byobu/.reuse-session
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 04 Dec 2017 07:46:48 -0600
byobu (5.124-0ubuntu1) bionic; urgency=medium

View file

@ -40,6 +40,7 @@ BYOBU_BACKEND = os.getenv("BYOBU_BACKEND", "tmux")
choice = -1
sessions = []
text = []
reuse_sessions = os.path.exists("%s/.reuse-session" % (BYOBU_CONFIG_DIR))
BYOBU_UPDATE_ENVVARS = ["DISPLAY", "DBUS_SESSION_BUS_ADDRESS", "SESSION_MANAGER", "GPG_AGENT_INFO", "XDG_SESSION_COOKIE", "XDG_SESSION_PATH", "GNOME_KEYRING_CONTROL", "GNOME_KEYRING_PID", "GPG_AGENT_INFO", "SSH_ASKPASS", "SSH_AUTH_SOCK", "SSH_AGENT_PID", "WINDOWID", "UPSTART_JOB", "UPSTART_EVENTS", "UPSTART_SESSION", "UPSTART_INSTANCE"]
@ -102,7 +103,7 @@ def cull_zombies(session_name):
# Find the master session to extract the group name. We use
# the group number to be extra sure the right session is getting
# killed. We don't want to accidentally kill the wrong one
pattern = "^%s:.+\\((group \\w+)\\).*$" % session_name
pattern = "^%s:.+\\((group [^\\)]+)\\).*$" % session_name
master = re.search(pattern, output, re.MULTILINE)
if not master:
return
@ -131,7 +132,11 @@ def attach_session(session):
cull_zombies(session_name)
# must use the binary, not the wrapper!
if backend == "tmux":
os.execvp("tmux", ["tmux", "-2", "new-session", "-t", session_name, "-s", "_%s-%i" % (session_name, os.getpid())])
if reuse_sessions:
os.execvp("tmux", ["tmux", "attach", "-t", session_name])
else:
os.execvp("tmux", ["tmux", "-2", "new-session", "-t", session_name, "-s", "_%s-%i" % (session_name, os.getpid())])
else:
os.execvp("screen", ["screen", "-AOxRR", session_name])