Repository navigation
fix(session): refuse run from a pane that names no pane - #1532
Merged
Merged
Conversation
Contributor
Binary size
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
force-pushed
the
fix/run-from-pane-needs-window
branch
from
November 4, 2026 09:05
d784c06 to
cd0ff87
Compare
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.
tuios runfrom 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-textandsend-keysalready refuse this from a pane.runnow 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
holdTypingTarget(internal/session/pane_grants.go),runjoinssend-textandsend-keysin thetypingNeedsWindowcheck.runverb description andtuios run --helpsay that-wis required from a pane.Verification
I extended
TestAPaneTypesOnlyWhereItAimsAndNotIntoAPromptinstead 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 callstuios run -- echo NOWIN_RUNwith no-w.-whint, and nothing reaches the focused pane.runtaken 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_RUNand its output. The run is ine2e/tui/NEGATIVE_CONTROLS.md.go test -run 'Grant|Typing|Run|Hold|Verb' ./internal/session/passes, andjust check --changedpasses.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 printedNOWIN_RUN.Size
No change on linux/amd64 with the release flags. The binary is 46,915,744 bytes on main and on this branch.