From bf82a7f1ccdcfd6ab551d0649a65cdc8de86aafb Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 4 Jun 2026 02:53:56 -0700 Subject: [PATCH] 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. --- cli.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cli.py b/cli.py index cbb718b18..46167a774 100644 --- a/cli.py +++ b/cli.py @@ -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)