Skip to content

Close tmuxinator parity gaps in tmux and Herdr backends - #19

Merged
willfish merged 2 commits into
masterfrom
tmuxinator-parity-fixes
Nov 23, 2026
Merged

willfish merged 2 commits into
masterfrom
tmuxinator-parity-fixes

Conversation

@willfish

@willfish willfish commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

What?

  • Target tmux sessions exactly (=name) and windows/panes by index, so a project no longer starts or stops a prefix-matched session (work vs work-api), and duplicate, numeric or dotted window names build correctly
  • Convert . and : in session names to _, and require a project name
  • Run hooks from the project root without strict mode, so unset variables in a hook no longer abort the start
  • Abort only if the session or a window can't be created; other tmux failures (bad layout etc.) no longer stop the rest of the session being built, but mux exits non-zero at the end
  • Retry session creation once and treat start-server as best-effort, so mux stop a && mux start b doesn't fail while the tmux server is shutting down
  • Resolve relative project roots once in all three backends (previously root: app could resolve to app/app), join relative window roots onto the project root, and keep ~user expansion
  • Fall back to pane 0 for invalid focused_pane/startup_pane, focus the first pane by default, and set pane-title options per window rather than globally
  • Make stop exit 0 when the session isn't running, escape a trailing ; in pane commands, run on_project_restart in the herdr backend
  • --append adds to the current session and never attaches; stop-all stops only mux project sessions (including tmux_options sockets) instead of kill-server
  • Find projects across all config directories, subdirectories and .yaml; implode deletes only from the directory it asks you to confirm
  • Evaluate templates without CLI settings (plus @args and ENV), honour YAML 1.1 booleans, ignore ~/null window commands
  • Add --attach/--no-attach, --no-pre-window, new --local, flags after the project name, ./.tmuxinator.yml fallback and multi-project delete; fix fish completion and the reported version
  • Move CLI handling into src/app.c so it can be tested, wire the integration suites into meson, and install tmux plus run a sanitizer build in CI

Why?

A review against upstream tmuxinator, run on an isolated real tmux server, found configs that started or stopped the wrong session, failed partway through, or behaved differently from tmuxinator. The unit tests only compared generated script text, so none of this was caught.

Generated tmux scripts targeted sessions and windows by name, so a
project could start or stop the wrong session (prefix matches such as
work vs work-api) and duplicate, numeric or dotted window names broke
the build. Several start failures were fatal where tmuxinator carries
on, and others were silently masked.

- Target sessions exactly (=name) and windows/panes by index, honouring
  base-index and pane-base-index; sanitise . and : in session names.
- Run hooks from the project root without strict mode; abort only when
  the session or a window cannot be created, record other tmux failures
  and exit non-zero once the session is built.
- Retry session creation once and make start-server best-effort, so a
  start straight after stopping the server's last session does not fail.
- Resolve relative project roots once, before any cd, in all backends;
  join relative window roots onto the project root; keep ~user expansion.
- Fall back to pane 0 for invalid focused_pane and startup_pane; focus
  the first pane by default; scope pane-title options to each window.
- Guard stop behind has-session, escape a trailing ; in send-keys,
  append to the current session without attaching, and stop only mux
  project sessions in stop-all (including tmux_options sockets).
- Look up projects across all config directories, subdirectories and
  .yaml; restrict implode to the confirmed directory.
- Evaluate templates without CLI settings, honour YAML 1.1 booleans,
  ignore ~/null window commands and require a project name.
- Add --attach/--no-attach, --no-pre-window, new --local, flags after
  the project name, local-file fallback and multi-project delete; fix
  fish completion and the reported version.
- Move CLI handling into src/app.c for testing, wire the integration
  suites into meson and run tmux and sanitizer builds in CI.
macOS links /tmp and /var into /private, so paths that mux resolves
through getcwd() did not match the mktemp paths the tests expected.
Compare against the physical paths, and restore the working directory
after every script test so one failure cannot break fixture lookups in
later tests.
@willfish
willfish merged commit 77a9851 into master Nov 23, 2026
2 checks passed
@willfish
willfish deleted the tmuxinator-parity-fixes branch November 23, 2026 15:31
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.

1 participant