Repository navigation
fix(tmux): target sessions with a trailing colon so numeric session names resolve - #328
sandersjdd wants to merge 5 commits into
Conversation
…ames resolve tmux parses a bare numeric -t target as a window index in the current session, so spawning from the unnamed default session "0" failed with "create window failed: index 0 in use" (or silently landed the window in the wrong session for a free index). Target sessions as "$ses:" in fm_backend_tmux_create_task's list-windows and new-window calls, which tmux unambiguously parses as a session. has-session keeps its bare fixed non-numeric "firstmate" target; all other -t usages already pass session:window composites or window names. Verified on tmux 3.6a against a private-socket server; the extended smoke test reproduces the failure pre-fix and passes post-fix.
…poser-state readers
…C composer fixtures
…ed test coverage docs
|
Thanks for the PR! This branch currently has a merge conflict with the base branch. When you get a chance, please rebase onto (or merge) the latest base branch, resolve the conflict, and push. After that, checks will re-run and the PR will get looked at again. Noted for firstmate#328 at |
|
Automated reminder: this PR still looks blocked on a rebase or merge conflict fix. If you are still interested, please rebase onto the current base branch, resolve the conflict, and push. If I do not hear back, I may close this as inactive. |
|
I am closing this because it has been waiting on a rebase or merge-conflict fix since 2026-07-10, and I have not seen a comment or push since then. If you still want to keep working on this, please reopen it or open a new PR and mention this one. Happy to take another look when there is an update. |
Merge 6 upstream commits (kunchenguid#353 AFK herdr escalations, kunchenguid#367 harness-aware supervision, kunchenguid#369 X-mode platform split, kunchenguid#372 stow inspect-before-update, kunchenguid#375 watcher wait-on-healthy-arm, kunchenguid#386 pi launch simplification) into the captain's 11 local-only commits. Resolved 3 documentation conflicts by union (CONTRIBUTING.md, docs/configuration.md, docs/scripts.md), preserving both the captain's local additions and upstream's new content. The one genuine contradiction - FM_BACKEND_HERDR_BARE_PROMPT_RE - keeps the captain's locale-safe alternation '^(|)' (matching the merged code default) with upstream's faint-Codex-suggestion note folded in. Semantic-merge audit of the watcher/guard/backend surface confirmed no behavioral collision: local orphan-marker guard, kunchenguid#328 numeric-session fix, and locale-safe regex/glyph fixes all coexist coherently with upstream's wait-on-healthy-arm, harness-aware supervision, and ANSI/faint herdr work.
Local verificationGitHub Actions is temporarily disabled for this repository (account free minutes exhausted), so no workflow job ran and local verification was used as the gate. Results on head
|
Problem
When firstmate runs inside a tmux session with a numeric name (the unnamed default session is
0), spawning a task fails withcreate window failed: index 0 in use.tmux parses a bare numeric
-ttarget as a window index in the current session rather than a session name; with a free numeric index (e.g.-t "5", no session named5) it instead silently creates the window in the wrong session.Observed live on 2026-07-06.
Fix
fm_backend_tmux_create_task(bin/backends/tmux.sh) now targets sessions with a trailing colon (-t "$ses:"), which tmux unambiguously parses as a session, in both itslist-windowsduplicate check and itsnew-windowcall.-tusages acrossbin/*.shandbin/backends/*.sh: these two were the only bare-session targets.has-session -t firstmateis deliberately left bare (it only accepts session targets and the name is a fixed non-numeric literal). All other targets aresession:windowcomposites or window names and are unchanged.Verification
tests/fm-backend-tmux-smoke.test.shgained a numeric-session section on a real private-socket tmux server (session named0): reproduced the exact live failure pre-fix, passes post-fix, asserts the window lands in session0and does not leak into another session, and duplicate refusal still works.docs/tmux-backend.mdgained a dated empirical note (tmux 3.6a) recording the observed behaviors, per the backend-verification-evidence guideline.shellcheck bin/*.sh bin/backends/*.sh tests/*.shclean; all 44tests/*.test.shscripts pass.Pipeline commits riding along
The branch was validated through the no-mistakes pipeline (review, test, document, lint all green); its head includes the pipeline's own fix commits:
215c297test-step fix: locale-sensitive prompt-glyph stripping in composer-state readers.fce68abreview fix round: locale-safe herdr bare-prompt regex plusLC_ALL=Ccomposer fixtures.e49f138,5bd40ecdocument-step syncs (CONTRIBUTING test coverage list, regex/coverage docs).The upstream push from the pipeline was blocked by repo permissions, so this PR delivers the validated head from a fork instead.