Skip to content

Commit c178f9f

Browse files
committed
fix(Server.session_name): Handle empty session names better
Avoid passing -s session_name when no session_name passed
1 parent 31d95a3 commit c178f9f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libtmux/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,13 @@ def new_session(
558558
del os.environ["TMUX"]
559559

560560
tmux_args: t.Tuple[t.Union[str, int], ...] = (
561-
"-s%s" % session_name,
562561
"-P",
563562
"-F%s" % formats.FORMAT_SEPARATOR.join(tmux_formats), # output
564563
)
565564

565+
if session_name is not None:
566+
tmux_args += (f"-s{session_name}",)
567+
566568
if not attach:
567569
tmux_args += ("-d",)
568570

0 commit comments

Comments
 (0)