From 63e34052c09ed2f6d4e1a750868e564a6fcb3341 Mon Sep 17 00:00:00 2001 From: sgherdao <104869962+sgherdao@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:11:05 +0100 Subject: [PATCH] fix: sanitize colons too in tmux session name 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.) --- virl/cli/tmux/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virl/cli/tmux/commands.py b/virl/cli/tmux/commands.py index aeb991f..b1d56b4 100644 --- a/virl/cli/tmux/commands.py +++ b/virl/cli/tmux/commands.py @@ -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")