mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
select-session.py: Pass command name in argument list
When calling os.execpv(), make sure the first argument in the argument list is the command name so that the command shows up in tools like ps. Example before: $ ps -a | grep 368 pts/4 S+ 0:00 -u -2 -f /usr/share/byobu/profiles/tmuxrc new-session -n - /usr/bin/byobu-shell 784 pts/5 S+ 0:00 -2 new-session -t 1 -s _1-784 8446 pts/3 S+ 0:00 -2 new-session -t 1 -s _1-8446 after: $ ps a [...] 368 pts/4 S+ 0:00 tmux -u -2 -f /usr/share/byobu/profiles/tmuxrc new-session -n - /usr/bin/byobu-shell 784 pts/5 S+ 0:00 tmux -2 new-session -t 1 -s _1-784 8446 pts/3 S+ 0:00 tmux -2 new-session -t 1 -s _1-8446
This commit is contained in:
parent
411807efad
commit
705dbc66ec
1 changed files with 5 additions and 5 deletions
|
@ -130,9 +130,9 @@ def attach_session(session):
|
||||||
cull_zombies(session_name)
|
cull_zombies(session_name)
|
||||||
# must use the binary, not the wrapper!
|
# must use the binary, not the wrapper!
|
||||||
if backend == "tmux":
|
if backend == "tmux":
|
||||||
os.execvp("tmux", ["", "-2", "new-session", "-t", session_name, "-s", "_%s-%i" % (session_name, os.getpid())])
|
os.execvp("tmux", ["tmux", "-2", "new-session", "-t", session_name, "-s", "_%s-%i" % (session_name, os.getpid())])
|
||||||
else:
|
else:
|
||||||
os.execvp("screen", ["", "-AOxRR", session_name])
|
os.execvp("screen", ["screen", "-AOxRR", session_name])
|
||||||
|
|
||||||
sessions = get_sessions()
|
sessions = get_sessions()
|
||||||
|
|
||||||
|
@ -180,9 +180,9 @@ if choice >= 1:
|
||||||
if sessions[choice - 1] == "NEW":
|
if sessions[choice - 1] == "NEW":
|
||||||
# Create a new session
|
# Create a new session
|
||||||
if BYOBU_BACKEND == "tmux":
|
if BYOBU_BACKEND == "tmux":
|
||||||
os.execvp("byobu", ["", "new-session", SHELL])
|
os.execvp("byobu", ["byobu", "new-session", SHELL])
|
||||||
else:
|
else:
|
||||||
os.execvp("byobu", ["", SHELL])
|
os.execvp("byobu", ["byobu", SHELL])
|
||||||
elif sessions[choice - 1] == "SHELL":
|
elif sessions[choice - 1] == "SHELL":
|
||||||
os.execvp(SHELL, [SHELL])
|
os.execvp(SHELL, [SHELL])
|
||||||
else:
|
else:
|
||||||
|
@ -194,4 +194,4 @@ if BYOBU_BACKEND == "tmux":
|
||||||
args = ""
|
args = ""
|
||||||
else:
|
else:
|
||||||
args = "-AOxRR"
|
args = "-AOxRR"
|
||||||
os.execvp("byobu", ["", args])
|
os.execvp("byobu", ["byobu", args])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue