Skip to content

Commit

Permalink
fix: sanitize colons too in tmux session name
Browse files Browse the repository at this point in the history
Fixes a bug with `cml tmux` when the lab name contains a colon (e.g. Lab at Sat 20:54 PM)

libtmux:
tmux(1) session names may not be empty, or include periods or colons.
These delimiters are reserved for noting session, window and pane.

(Starting, tmux 3.2+ sanitize colons and periods, replacing them with underscore.)
  • Loading branch information
sgherdao committed Apr 20, 2024
1 parent 0593c9b commit 63e3405
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virl/cli/tmux/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def tmux(group):
node_console_cmd.append((node_obj, cmd))

if node_console_cmd:
session_title = "{}-{}".format(str(lab.title).replace(".", "_"), lab.id[:4])
session_title = "{}-{}".format(str(lab.title).replace(".", "_").replace(":", "_"), lab.id[:4])
connect_tmux(session_title, node_console_cmd, group)
else:
click.secho("Unable to find any valid nodes", fg="red")
Expand Down

0 comments on commit 63e3405

Please sign in to comment.