Roadmap batch: project configs, dry-run, connection holding, lifecycle hooks#13
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Works through four of the roadmap issues. Each landed as its own commit with tests, and the branch is lint-clean.
./.mox.ymlin the working directory now wins over the global config (stderr notice on user-facing commands,--configstill overrides, completion loaders stay quiet). Project session layouts can live in the repo they belong to.--printonmox newandmox -aemits 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.syncwindow the old behavior let broadcast keystrokes (sudo passwords included) execute on the local machine.hold: falseopts out;retry: Nre-attempts failed connections, 3s apart, never retrying clean exits.on_start/on_stophooks run locally around the session lifecycle (a failing on_start aborts creation), andprecommands are prepended to every pane's command list.mox killnow 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: