Escape tmux session name

This will, for example, allow session names to have whitespace (not that
that's a good idea, but if the session name is quoted like -s "a b",
then the expected behavior is to get a session named "a b" not for tdrop
to fail).
break
noctuid 9 years ago
parent 702f047b6b
commit f4f58b66e9

@ -483,6 +483,7 @@ program_start() {
local program_command tmux_command wid local program_command tmux_command wid
program_command="$program $program_flags" program_command="$program $program_flags"
if [[ -n "$session_name" ]]; then if [[ -n "$session_name" ]]; then
session_name=$(printf "%q" "$session_name")
tmux_command="'tmux attach-session -dt $session_name || \ tmux_command="'tmux attach-session -dt $session_name || \
tmuxinator start $session_name || \ tmuxinator start $session_name || \
tmux new-session -s $session_name'" tmux new-session -s $session_name'"

Loading…
Cancel
Save