fix(cli): erase live chrome on exit so it isn't stranded above the session summary#38906
Merged
Conversation
…ssion summary Sets erase_when_done=True on the classic CLI's prompt_toolkit Application so the live bottom chrome (status bar, input box, separator rules) is wiped on exit instead of frozen into scrollback. Previously prompt_toolkit's render_as_done teardown repainted the chrome one final time and left it on screen (ESC[J only erases below the cursor, not the chrome above), so a dead status bar + empty prompt + rules were stranded between the conversation transcript and the 'Resume this session' summary, and stacked with the next session's UI on resume. erase_when_done routes teardown through renderer.erase() which wipes exactly the managed chrome region; the conversation transcript prints through patch_stdout into normal scrollback and is untouched. Applies to every exit path (/exit, /quit, EOF, Ctrl+C). Fixes #38252.
Contributor
🔎 Lint report:
|
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.
Summary
On exit, the classic CLI no longer strands its live chrome (status bar, input box, separator rules) above the session summary. Fixes #38252.
Root cause: prompt_toolkit's
render_as_doneteardown repaints the bottom chrome one final time and leaves it on screen (ESC[Jonly erases below the cursor, not the chrome above). So a dead status bar + empty❯prompt + rules were left between the conversation transcript and the "Resume this session" block, and stacked with the next session's UI on resume. Reproduces on Linux and Windows.Changes
cli.py: seterase_when_done=Trueon the classic REPL's prompt_toolkitApplication. Teardown now routes throughrenderer.erase()(wipes exactly the managed chrome region) instead of repainting it. The conversation transcript prints throughpatch_stdoutinto normal scrollback and is untouched. Applies to every exit path (/exit,/quit, EOF, Ctrl+C).Validation
Rendered the real exit byte stream through a
pyteterminal emulator (final on-screen grid, not frame history) before/after:/exit❯+ rules stranded above summarytests/cli/— 888/888 pass.Infographic