Skip to content

fix(session): refuse run from a pane that names no pane - #1532

Merged
Gaurav-Gosain merged 1 commit into
mainfrom
fix/run-from-pane-needs-window
Nov 4, 2026
Merged

Gaurav-Gosain merged 1 commit into
mainfrom
fix/run-from-pane-needs-window

Conversation

@Gaurav-Gosain

Copy link
Copy Markdown
Owner

tuios run from inside a pane, with no -w, typed the command into the pane the person had in focus. When that pane was a shell at its prompt, the command ran there. send-text and send-keys already refuse this from a pane. run now gets the same refusal, and nothing is typed.

I found it while I compared the herdr and Rex agent skills with ours. herdr tells agents never to rely on another client's focused pane. Our daemon enforces that for two typing verbs and missed the third.

Scope

  • In holdTypingTarget (internal/session/pane_grants.go), run joins send-text and send-keys in the typingNeedsWindow check.
  • The run verb description and tuios run --help say that -w is required from a pane.
  • A caller outside every pane still gets the focused pane, as before.

Verification

I extended TestAPaneTypesOnlyWhereItAimsAndNotIntoAPrompt instead of adding a test. The focused pane is now a bash that marks its commands, and the probe waits until that shell is at its prompt. Then the probe calls tuios run -- echo NOWIN_RUN with no -w.

  • With the fix, the test passes. The call exits 1 with the -w hint, and nothing reaches the focused pane.
  • With run taken out of the check, the test fails twice. The call is "not refused with a hint to pass -w", and the focused pane shows $ echo NOWIN_RUN and its output. The run is in e2e/tui/NEGATIVE_CONTROLS.md.
  • go test -run 'Grant|Typing|Run|Hold|Verb' ./internal/session/ passes, and just check --changed passes.

I also reproduced it by hand on a scratch daemon before the fix. A probe pane ran tuios run -- echo NOWIN_RUN, and the focused bash printed NOWIN_RUN.

Size

No change on linux/amd64 with the release flags. The binary is 46,915,744 bytes on main and on this branch.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Binary size

target this change main change room under the ceiling
darwin/arm64 43724338 bytes 43707250 bytes +17088 bytes (+16.7 KiB) 3275662 bytes
linux/amd64 46940320 bytes 46919840 bytes +20480 bytes (+20.0 KiB) 59680 bytes

The ceiling is 47000000 bytes for each target. Main's size is from main at f75ac39 (https://github.com/Gaurav-Gosain/tuios/actions/runs/41796786838).

State the size cost in the pull request body. CI fails only above the ceiling.

tuios run from inside a pane with no -w typed the command line into the
pane the person had in focus. When that pane was a shell at its prompt,
the command ran there. send-text and send-keys already refuse this from a
pane, in holdTypingTarget. run now gets the same refusal, and nothing is
typed. A caller outside every pane still gets the focused pane.

TestAPaneTypesOnlyWhereItAimsAndNotIntoAPrompt now gives the focused pane
a bash that marks its commands, and its probe calls run without -w. With
run taken out of the check, the probe's command runs in the focused pane
and the test fails.
@Gaurav-Gosain
Gaurav-Gosain force-pushed the fix/run-from-pane-needs-window branch from d784c06 to cd0ff87 Compare November 4, 2026 09:05
@Gaurav-Gosain
Gaurav-Gosain merged commit cd0ff87 into main Nov 4, 2026
35 checks passed
@Gaurav-Gosain
Gaurav-Gosain deleted the fix/run-from-pane-needs-window branch November 4, 2026 09:44
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