Skip to content

fix(cli): erase live chrome on exit so it isn't stranded above the session summary#38906

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-cf24b906
Jun 4, 2026
Merged

fix(cli): erase live chrome on exit so it isn't stranded above the session summary#38906
teknium1 merged 1 commit into
mainfrom
hermes/hermes-cf24b906

Conversation

@teknium1

@teknium1 teknium1 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

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_done teardown repaints the bottom chrome one final time and leaves it on screen (ESC[J only 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: set erase_when_done=True on the classic REPL's prompt_toolkit Application. Teardown now routes through renderer.erase() (wipes exactly the managed chrome region) instead of repainting it. The conversation transcript prints through patch_stdout into normal scrollback and is untouched. Applies to every exit path (/exit, /quit, EOF, Ctrl+C).

Validation

Rendered the real exit byte stream through a pyte terminal emulator (final on-screen grid, not frame history) before/after:

Exit path Before After
/exit dead status bar + + rules stranded above summary chrome gone; transcript + summary clean
EOF (Ctrl+D) same stranded chrome chrome gone; clean
  • Transcript preserved after fix (conversation reply, welcome banner, and resume summary all still present in scrollback).
  • tests/cli/ — 888/888 pass.

Infographic

clean-exit-handoff

…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.
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: hermes/hermes-cf24b906 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 9788 on HEAD, 9788 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5081 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1 teknium1 merged commit bf82a7f into main Jun 4, 2026
22 checks passed
@teknium1 teknium1 deleted the hermes/hermes-cf24b906 branch June 4, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Hermes Agent does not cleanly hand control back to CLI after session ends

1 participant