Skip to content

Sanitize whitespace in tmux session names#87

Open
kestermcullough wants to merge 1 commit intostandardagents:mainfrom
kestermcullough:fix/session-name-whitespace
Open

Sanitize whitespace in tmux session names#87
kestermcullough wants to merge 1 commit intostandardagents:mainfrom
kestermcullough:fix/session-name-whitespace

Conversation

@kestermcullough
Copy link
Copy Markdown

@kestermcullough kestermcullough commented Apr 29, 2026

Project paths containing spaces produced session names like dmux-my project-abcd1234. Those names get interpolated unquoted into chained tmux commands in applySessionPaneBorderOptions (e.g. tmux set-option -t ${sessionName} pane-border-status top \; set-option ...), which tmux then parses with extra tokens and aborts:

command set-option: too many arguments (need at most 2)

Fix: replace any non-[A-Za-z0-9_-] run with - when building the session identifier (a superset of the existing . sanitization).

Repro: mkdir "/tmp/foo bar" && cd "/tmp/foo bar" && git init && dmux

(I ran into this problem while using WSL within Windows, on MacOS this did not occur with space names, FYI).

Project paths containing spaces produced session names like
'dmux-my project-abcd1234' that broke chained tmux commands
(e.g. set-option -t $sessionName ...) with 'too many arguments'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants