Repository navigation
fix(terminal): let go of an idle tab's pane beside herdr's own window - #2002
Conversation
With Settings > Use alongside herdr's own window on, a tab in use that types straight into the grid lets go of its pane after 10 s without a key, click, paste or composition in its terminal, so herdr's own window has the pane at its size again (#712). The next key takes the pane back; keys typed until the new attach takes input are sent once, in order. If that attach fails, the connection drops, the attach is given up or 5 s pass, they are held for review instead, and never kept while a masked prompt is on screen.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CodeRabbit did not review this PR (its "Review limit reached" comment above). This change touches queued input and attach behaviour, so per AGENTS.md two code-review agents' reviews stand in. Both ran on this branch before the push. Their findings and how each was resolved: Codex Sol, round 1: REQUEST CHANGES
Codex Sol, round 2: APPROVE. All four closed; verified by source tracing plus in-memory probes for ordered sending, cancellation, both expiry paths, secret-at-failure and pane replacement. omo-native-code-reviewer, round 1: REQUEST CHANGES. The buffer could still be sent after an attach error, and the fallback paths had no tests. Fixed: Declined after review: keys typed while a resume is cut short by a pane switch are dropped, not sent to the other pane, which is the safe failure. The idle timer still arms with the setting off but never releases. Evidence: a mutation that disables the resume buffer makes |
|
Merge pass review report. Overall: PASSED. This is a client change to the terminal attach lifecycle. The Astra gate (omo-native-gate-reviewer, gpt-6-astra) approved eb8c508. What it does: while a browser tab holds a pane's attach, herdr keeps the pane at that attach's size, so herdr's own window (a TUI) draws the pane cut off (#712). An idle tab now lets go of the attach, and there is a setting for this. Gate results:
Not exercised:
|
Closes #712.
Problem
herdr keeps a pane at the size of a
herdr terminal attach. A browser tab in use holds thatattach, so while it stays open herdr's own window (a TUI in a terminal, on this PC or another)
draws the pane cut off, and typing and clicks there land in the wrong place. Measured on herdr
0.9.5 in an isolated session: a TUI at 80x30 showed the pane at 53x29 while an attach from a
145x39 pty held it at 39x145, and growing the TUI did not take the size back; the pane followed
the TUI only once the attach ended.
terminal session observenever resizes the pty.herdr gives no way to attach with input but without the size: herdrdev/herdr#4682 (attach
without resize authority) is still open, #5553 (client claims size) was closed as not planned and
#5036 as intended. The 0.9.5 API also lists no attached clients and no exact pane size, so the
client cannot tell whether herdr's own window is open. The only lever is to stop holding the
attach when the tab is not typing.
Fix
Client only:
server/,shared/, the WS contract and herdr are unchanged. It extends theexisting opt-in Settings -> Terminal -> Use alongside herdr's own window (
releasePaneAway,off by default), which already lets go of the pane a second after the tab goes out of use.
With it off nothing changes.
IDLE_RELEASE_MS(10 s) without a key, click, paste or IME composition in it, through the samerelease machinery: detach, then the read-only watch view at herdr's size. The banner says
"View only while you are not typing here · type or click to type". 10 s was chosen over 5 s,
which flipped the size too often while reading output.
--takeover; a held pane shows the usual "Another app has this pane open").included, when it takes input within
RESUME_INPUT_WAIT_MS(5 s). If the attach is held, fails,the pane ends, the connection drops, the attach is given up or the wait runs out, it goes to the
existing held draft for Send/Discard, never by itself. Keys typed while a masked prompt is on
screen (including one drawn in the watch view) are never kept (src/AGENTS.md).
a masked prompt, a selection, the find bar, an IME composition, and bridges without
watch.Verification
scripts/chat-size-regression.ts(checkInactiveAttachLifecycle) addsidle,idle-off,idle-held,idle-offline,idle-expiredandidle-secret: idle -> detach + watch + banner ->the bridge's attach ends -> typed line -> one attach at this window's size -> the line runs
once, first key included; setting off keeps the attach; held/offline/expired keys go to the
draft; a password is never held. A mutation (resume buffer disabled) makes
idlefail. Fullchat-size suite passes.
i712-3-rec, a herdr TUI client at 100x30 beside a 1280x720 tab;the overlay reads the pane's own
stty size). Measured in it: herdr's window alone 73x29 -> thetab typing 145x33 -> banner "View only while you are not typing here" after 10.3 s and the pane back
at 73x29 -> the next line typed takes it back at 145x33 and runs once.
bun run check fastgreen.Reviews before this PR: Codex Sol APPROVE, omo-native-code-reviewer APPROVE WITH NOTES. This
touches attach behaviour and queued input, so it asks for a real review.
UI wording follows the existing Ovis release banner ("View only while you use another window");
no external app's design is copied.