tmux/Q/Why does a session name containing a dot break every bare -t target?
Properties
- logseq-entity
- Logseq/Entity/Question
Why does a tmux session name containing a dot break every bare
-ttarget?AI Answer
- Short answer: a
-ttarget is parsed assession:window.pane, so a dot inside the session name is read as the window/pane separator. The lookup then runs against a window or a pane that does not exist, and the error names that window or pane rather than the session — which is why it reads as a missing session. Keep dots out of session names. The parse, and where the name goes
session:window.paneis the target form. Every part is optional, sohay-.Fis not rejected as malformed — it is accepted and split, withFtaken as the pane.- The split happens on the first
:and the first., wherever they sit. A dot at the start of a suffix, in the middle of one, or in the middle of the name all break the same way; only the reported half changes.
Reproduced
- Measured on 2026-08-24 Mon against tmux/v/3.7b, on an isolated socket rather than the server holding live work:
target exit message has-session -t '=hay-.F'1can't find pane: Fhas-session -t 'hay-.F'1can't find pane: Flist-windows -t '=hay-.F'1can't find pane: Fnew-window -d -t '=hay-.F'1can't specify pane herehas-session -t '=hay-D.F'1can't find window: hay-Dhas-session -t '=hay.DF'1can't find window: hayhas-session -t '=hay-DF'0— - The last row is the control: the same name with the dot removed answers cleanly.
It is not the
=prefix, and not the shellhas-session -t 'hay-.F'fails identically to-t '=hay-.F', so exact-match plays no part. The target was quoted throughout, so zsh's equals expansion plays no part either — that is the separate fault on tmux/Q/Why does a tmux -t =session target fail in zsh?.- The two share a symptom and nothing else. Both report a name as not found while the session is sitting in
list-sessions, and neither message contains the word session.
Why the error text is the expensive part
- The message moves with the dot.
hay-.Freports a missing pane;hay-D.Freports a missing window namedhay-D, a string that appears nowhere. Two instances of one fault do not look alike, so recognising the second from having debugged the first does not happen. new-windowfails withcan't specify pane here— an argument-shape complaint about a command that was given no pane, which points away from the name entirely.
- The message moves with the dot.
has-sessioncannot answer, which is the real costThe workarounds, and why they are not a convention
- A trailing colon disambiguates —
-t '=hay-.F:'exits0— and an explicit window works too:-t '=hay-.F:0'lists panes normally. - Both are correct and neither is safe to build on. A naming scheme that holds only while everyone remembers a trailing colon fails at the first bare target anyone writes, including one written by a tool. An explicit window is also the case that hides the fault during testing: it is the one target shape a stray dot leaves alone, so a probe built from
session:0targets passes on every input it is given.
- A trailing colon disambiguates —
Sources
- tmux(1) man page — COMMANDS — defines the
session:window.panetarget form the parse above follows.
- tmux(1) man page — COMMANDS — defines the
- Short answer: a