Skip to content

Roadmap batch: project configs, dry-run, connection holding, lifecycle hooks#13

Merged
bthall merged 5 commits into
mainfrom
feat/roadmap
Jul 9, 2026
Merged

Roadmap batch: project configs, dry-run, connection holding, lifecycle hooks#13
bthall merged 5 commits into
mainfrom
feat/roadmap

Conversation

@bthall

@bthall bthall commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Works through four of the roadmap issues. Each landed as its own commit with tests, and the branch is lint-clean.

  • Closes Per-directory config: auto-detect ./.mox.yml #10: ./.mox.yml in the working directory now wins over the global config (stderr notice on user-facing commands, --config still overrides, completion loaders stay quiet). Project session layouts can live in the repo they belong to.
  • Closes Dry-run: print the tmux commands instead of running them #9: --print on mox new and mox -a emits the exact tmux commands instead of executing them. The dry client sits at the Run layer, so what prints is the real argv construction, and tmux doesn't even need to be installed.
  • Closes Keep failed connection panes visible (and optionally retry) #6: host panes no longer drop to a local shell when a connection ends. The pane now prints a notice and waits for Enter before closing. This closes a real hazard: in a sync window the old behavior let broadcast keystrokes (sudo passwords included) execute on the local machine. hold: false opts out; retry: N re-attempts failed connections, 3s apart, never retrying clean exits.
  • Closes Lifecycle hooks: on_start / on_stop, per-window pre commands #7: on_start/on_stop hooks run locally around the session lifecycle (a failing on_start aborts creation), and pre commands are prepended to every pane's command list. mox kill now routes through the manager so on_stop actually fires.

#5 (mox add) and #8 (config variables) stay open for after v0.2.0.

Merge order: #12 first. This branch predates it and I'll rebase before this one lands.

Sample of the new dry-run output with retry+hold active:

tmux send-keys -t %1 'for _mox_try in 1 2 3; do ssh web1 && break; printf '\''[mox] web1: connection failed (attempt %s)\n'\'' "$_mox_try"; sleep 3; done; printf '\''\n[mox] web1: connection ended. Press Enter to close this pane.\n'\''; read -r _mox_ack; exit' C-m

bthall added 5 commits July 9, 2026 08:40
Project session definitions can live in the repo they belong to. When
./.mox.yml exists and no --config was given, it wins over the global
path for every command that reads or writes the config; user-facing
commands say so on stderr, silent loaders (completion, expansion) stay
quiet so shell prompts aren't corrupted. An explicit --config always
overrides. Closes #10 behavior.
'mox new --print' and 'mox -a NAME --print' emit the exact tmux
commands a build would run, one copy-pasteable line each, without
executing anything (tmux doesn't even need to be installed). The dry
client lives at the Run layer so the printed argv is the real
construction code, with just enough fabricated output (window/pane
ids, existence checks) to drive the builder end to end. Dry runs skip
history recording. Closes #9 behavior.
When a host pane's connection ends (failure or clean exit), the pane
used to drop back to a local shell — in a sync window, broadcast
keystrokes (including sudo passwords) would then execute locally. The
connect command is now wrapped so an ended connection prints a notice
and waits for Enter before the pane closes. 'hold: false'
(session/window/--hold=false) restores the old behavior; 'retry: N'
re-attempts failed connections, 3s apart, never retrying clean exits.
Closes #6 behavior.
on_start commands run locally (sh -c, terminal attached) before a
session is built; the first failure aborts creation and nothing is
created. on_stop commands run after 'mox kill' destroys a managed
session, best-effort. pre commands (session- and window-level) are
prepended to every pane's command list, including panes with no
commands of their own. 'mox kill' now goes through the manager so
on_stop actually fires; --print mode prints hooks instead of running
them. Closes #7 behavior.
@bthall bthall merged commit fd6ae20 into main Jul 9, 2026
5 checks passed
@bthall bthall deleted the feat/roadmap branch July 9, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant