dor split: focus the new surface, stay put when given an initial command#233
Merged
Conversation
`dor split` hands the user a fresh terminal to work in, so focus now moves to the new surface (in passthrough mode the selection carries DOM focus, so the user types straight into it). `dor split -- <command>` instead launches the command in the background and leaves focus on the calling surface, matching `dor ensure` / `dor iframe` / `dor ab`. The discriminator is the presence of an initial command, wired through `createSplitSurface`'s existing `focusNeutral` flag in the host control handler. Adds a Wall integration test asserting the focus prop transfers for bare split and stays put for split-with-command, updates the dor-cli spec, the `dor split --help` text, and its snapshot. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying mouseterm with
|
| Latest commit: |
9108212
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://c0979d81.mouseterm.pages.dev |
| Branch Preview URL: | https://split-focus.mouseterm.pages.dev |
dormouse-bot
approved these changes
Jul 8, 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.
What
Makes
dor splitfocus behavior depend on whether an initial command is given:dor split— hands the user a fresh terminal to work in, so focus now moves to the new surface. In passthrough mode (the normal case — you typeddor splitinto a focused terminal) the selection carries DOM focus, so the user types straight into the new terminal.dor split -- <command>— launches the command in the background and leaves focus on the calling surface, matchingdor ensure/dor iframe/dor ab.How
The discriminator is simply the presence of an initial command. It's wired through
createSplitSurface's existingfocusNeutralflag in the host control handler (use-dor-control.ts) — a one-line policy change (focusNeutral: command !== undefined); no new plumbing.Previously both forms selected the new pane (so
dor split -- cmdincorrectly stole focus).Tests
Wall+useDorControl+ Lath store; only the xterm-heavyTerminalPaneis mocked, reflecting itsisFocuseddecision as a data attribute):dor splittransfers focus to the new surfacedor split -- <command>keeps focus on the callerpnpm testfordor(69) andlib(1045) pass;spec-lintpasses;tsc -bclean.Docs
dor splitentry indocs/specs/dor-cli.md.dor split --helpfullDescriptionand regenerates its snapshot.🤖 Generated with Claude Code