From 705dbc66ecf9ef42dd263a398410b071986e25e6 Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Thu, 16 Jun 2016 22:26:04 +0100 Subject: [PATCH] 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 --- usr/lib/byobu/include/select-session.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/usr/lib/byobu/include/select-session.py b/usr/lib/byobu/include/select-session.py index 930736b4..76e26a22 100755 --- a/usr/lib/byobu/include/select-session.py +++ b/usr/lib/byobu/include/select-session.py @@ -130,9 +130,9 @@ def attach_session(session): cull_zombies(session_name) # must use the binary, not the wrapper! 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: - os.execvp("screen", ["", "-AOxRR", session_name]) + os.execvp("screen", ["screen", "-AOxRR", session_name]) sessions = get_sessions() @@ -180,9 +180,9 @@ if choice >= 1: if sessions[choice - 1] == "NEW": # Create a new session if BYOBU_BACKEND == "tmux": - os.execvp("byobu", ["", "new-session", SHELL]) + os.execvp("byobu", ["byobu", "new-session", SHELL]) else: - os.execvp("byobu", ["", SHELL]) + os.execvp("byobu", ["byobu", SHELL]) elif sessions[choice - 1] == "SHELL": os.execvp(SHELL, [SHELL]) else: @@ -194,4 +194,4 @@ if BYOBU_BACKEND == "tmux": args = "" else: args = "-AOxRR" -os.execvp("byobu", ["", args]) +os.execvp("byobu", ["byobu", args])