Files
hermes-agent/hermes_cli
Teknium 4981c6f006 fix(cli): Ctrl+D leaves a curses menu once raw mode is on, like Esc
Before a menu switches the tty to raw mode, Ctrl+D is EOF and aborts it;
after, it arrives as byte 4 (or a CSI-u / modifyOtherKeys Ctrl+d), which
_decode_menu_key mapped to nothing, so the menu just redrew. Whether Ctrl+D
left a menu depended on timing.

The shared-metrics offer (#133571) made that visible: it is drawn before an
interactive chat on any profile that has not answered, and
test_entrypoint_in_a_fresh_process[module-interactive-cli] (which ends the CLI
with EOF) hung for its full 300 s whenever raw mode won the race.

Ctrl+D now decodes to NAV_CANCEL in all three encodings, the same as Esc.

Live (real `python -m hermes_cli.main` on a pty, fresh home, Ctrl+D sent 3 s
after the offer drew): main redrew the offer 20 times and never exited; fixed,
the offer is left at once and the CLI exits rc=0 after 4 presses.
2026-10-06 02:53:00 -07:00
..
…
…
…
…
…
…