Repository navigation
feat(terminal): pin the input line to a fixed footer row in every state - #952
Merged
Merged
Conversation
…state The prompt used to render wherever the transcript ended, so it moved with every scroll, tool call, and state change (interactive / worker / coordinator / mid-turn type-ahead). Give the footer a dedicated INPUT row at H-2 -- third line up from the bottom, directly below the horizontal rule at H-3, above the status message (H-1) and statusline (H). - FooterLayout grows sep_row/input_row; footer height 4 (6 with a tray). - LAST_PROMPT caches the prompt so EVERY repaint (heartbeat, resize, post-clear restore, mid-turn update) redraws the resting affordance -- this is what makes the row unconditional. - park_input_row/unpark_input_row move the editor onto the row for a read and hand the cursor back to the body; the submitted line is echoed into the body so scrollback stays honest (the row is outside DECSTBM). - print_in_body routes above-the-prompt output into the transcript with DECSC/DECRC instead of rustyline's ExternalPrinter, which would erase and redraw a prompt that no longer lives in the body. - BODY_ROW tracks where the transcript left off: one bounded DSR probe per park, advanced per body write, clamped into the live body on read. - Row precedence: live editor while reading > mid-turn type-ahead > cached resting prompt. All helpers no-op with no footer installed, so off-tty and short-window behaviour is unchanged.
Merged
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
The prompt used to render wherever the transcript happened to end, so the input line moved with every scroll, tool call, and state change. This pins it to a fixed footer row that is present in every shell state — interactive, mid-turn, tool call, worker, coordinator, goal, idle.
H-3H-2H-1HHow
FooterLayoutgrowssep_row+input_row; footer height 4 (6 with an escalation tray), with graceful degradation in short windows (down to just input + bar at 4 rows, then disabled entirely).LAST_PROMPTcaches the prompt string so every repaint path — idle heartbeat, resize, post-clear restore, mid-turn status update — redraws the resting affordance on that row. This is what makes the row unconditional rather than only-while-reading.MIDTURN_INPUT) → cached resting prompt.park_input_row/unpark_input_rowmove the editor onto the row for a read and hand the cursor back to the body. The row sits outside DECSTBM, so the submitted line is echoed into the body on submit and scrollback stays honest.print_in_bodyroutes above-the-prompt output straight into the transcript via DECSC/DECRC instead of rustyline'sExternalPrinter, which would erase-and-redraw a prompt that no longer lives in the body.BODY_ROWtracks the transcript position: one bounded DSR probe per park, advanced per body write, clamped into the live body on read. Worst case degrades to "write at the bottom" — never corruption.Known limitation
A typed line that wraps past the bottom row scrolls the screen, since the editor draws outside the scroll region. The next heartbeat repaint heals the footer. Documented in-code.
Verification
Files:
src/terminal.rs(+384/−129),src/editor.rs,src/tools.rs,CHANGELOG.md.Branched directly off
main(99a81c5) — no conflicts.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.