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

- commit edeae41 fixed the excessive creation of sessions by not
    creating different sessions. This commit adjust the behavior in a way
    that having .reuse-sessions enabled tmux will properly attach and remove
    sessions when dettaching and will also kill the last session available
  - When more than two sessions exist, tmux asks which session to use
This commit is contained in:
Dustin Kirkland 2020-02-09 10:35:32 -06:00
commit d38207de91
2 changed files with 14 additions and 3 deletions

10
debian/changelog vendored
View file

@ -4,12 +4,20 @@ byobu (5.131) unreleased; urgency=medium
* debian/control: Closes: #949941
- build-depend on python3-pep8, rather than pep8 transitional package
[ github.com/llitz ]
* usr/lib/byobu/include/select-session.py: LP: #1750430
- commit edeae41 fixed the excessive creation of sessions by not
creating different sessions. This commit adjust the behavior in a way
that having .reuse-sessions enabled tmux will properly attach and remove
sessions when dettaching and will also kill the last session available
- When more than two sessions exist, tmux asks which session to use
[ Chris Coulson ]
* usr/share/byobu/keybindings/f-keys.tmux: LP: #1861555
- Update usage of tmux swap-window so that focus stays with the
original window.
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 09 Feb 2020 10:25:20 -0600
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 09 Feb 2020 10:34:14 -0600
byobu (5.130-0ubuntu1) focal; urgency=medium

View file

@ -80,7 +80,7 @@ def get_sessions():
if output:
for s in output.splitlines():
# Ignore hidden sessions (named sessions that start with a "_")
if s and not s.startswith("_"):
if s and not s.startswith("_") and s.find("-") == -1:
text.append("tmux: %s" % s.strip())
sessions.append("tmux____%s" % s.split(":")[0])
i += 1
@ -132,7 +132,10 @@ def attach_session(session):
cull_zombies(session_name)
# must use the binary, not the wrapper!
if backend == "tmux":
os.execvp("tmux", ["tmux", "-u", "attach", "-t", session_name])
if reuse_sessions:
os.execvp("tmux", ["tmux", "-u", "new-session", "-t", session_name, ";", "set-option", "destroy-unattached"])
else:
os.execvp("tmux", ["tmux", "-u", "attach", "-t", session_name])
else:
os.execvp("screen", ["screen", "-AOxRR", session_name])