fix(cli): erase live chrome on exit so it isn't stranded above the session 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.
This commit is contained in:
Teknium
2026-06-04 02:53:56 -07:00
parent aeec88c77f
commit bf82a7f1cc

11
cli.py
View File

@ -14874,6 +14874,17 @@ class HermesCLI:
style=style,
full_screen=False,
mouse_support=False,
# Erase the live bottom chrome (status bar, input box, separator
# rules) on exit instead of freezing a final copy into scrollback.
# Without this, prompt_toolkit's render_as_done teardown repaints
# the chrome one last time and leaves it stranded above the exit
# summary — so a dead status bar + empty prompt sit between the
# conversation transcript and the "Resume this session" block, and
# stack with the next session's UI on resume (#38252). The actual
# conversation transcript is printed through patch_stdout into
# normal scrollback and is unaffected; only the managed chrome is
# erased. Applies to every exit path (/exit, /quit, EOF, Ctrl+C).
erase_when_done=True,
**({'cursor': _STEADY_CURSOR} if _STEADY_CURSOR is not None else {}),
)
_disable_prompt_toolkit_cpr_warning(app)