dor ensure: add --restart to interrupt and re-run a matching surface#158
Open
nedtwigg wants to merge 2 commits into
Open
dor ensure: add --restart to interrupt and re-run a matching surface#158nedtwigg wants to merge 2 commits into
nedtwigg wants to merge 2 commits into
Conversation
`dor ensure --restart -- <command>` now restarts a surface that is already running the command instead of no-opping. The host interrupts the live command (Ctrl+C), waits for the shell to return to its prompt, types the command again, and waits for it to go live — driving the PTY directly so it works for minimized doors too. The CLI blocks until the restart completes (with a bumped 60s request timeout for that one command). With no matching surface, --restart behaves like a plain ensure and creates one. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
c9fdaad
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://49a95b05.mouseterm.pages.dev |
| Branch Preview URL: | https://ensure-fixup.mouseterm.pages.dev |
dormouse-bot
approved these changes
Jun 19, 2026
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
Adds a
--restartflag todor ensure. When a surface is already running the target command,--restartinterrupts it (Ctrl+C), waits for the shell to return to its prompt, re-runs the command in place, and blocks until it's live again. If no surface matches, it behaves like a plainensureand creates one.--restartdrives the live PTY directly, so it works for minimized doors too (their PTY keeps running). A restarted surface keeps its minimized/visible state.currentCommandclears on prompt, then reports the command live again) rather than guessing at timings.restartedstatus surfaces in text and JSON output, with help text and snapshots updated.Test plan
dor/test/cli-output.test.mjscovers--restartplumbing (sendsrestart: true, rendersrestarted surface:3).tsc --noEmitpasses inlib.🤖 Generated with Claude Code