Commit 79ac1f5
refactor(cli): drop dead c-S-c key binding (follow-up to NousResearch#19895) (NousResearch#19919)
NousResearch#19884 added a prompt_toolkit key binding for Ctrl+Shift+C to
"prevent Hermes from intercepting the keystroke as an interrupt
signal." NousResearch#19895 then wrapped the binding in try/except after
discovering it crashed startup with ValueError on every platform.
Both PRs were based on a misreading of how terminal key events
propagate:
1. Terminal emulators (GNOME Terminal, iTerm2, kitty, Windows Terminal,
etc.) intercept Ctrl+Shift+C before the keystroke reaches the
application's stdin. prompt_toolkit never sees it. The binding
could never have intercepted anything.
2. prompt_toolkit's key spec parser doesn't recognise 'c-S-c' on any
platform — the Shift modifier is meaningless on control-sequence
keys. Verified: every prompt_toolkit version raises 'Invalid key:
c-S-c' at registration time.
The handler is dead code. Delete it and leave a comment explaining
why no binding is needed here. Ctrl+Q alias (NousResearch#19884's other addition)
stays — that's a real prompt_toolkit key and a legitimate interrupt
shortcut.
Verified the CLI starts cleanly — key binding phase no longer raises
and the subsequent chat flow reaches the provider setup check without
error.1 parent 2e2026f commit 79ac1f5
1 file changed
Lines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10484 | 10484 | | |
10485 | 10485 | | |
10486 | 10486 | | |
10487 | | - | |
10488 | | - | |
10489 | | - | |
10490 | | - | |
10491 | | - | |
10492 | | - | |
10493 | | - | |
10494 | | - | |
10495 | | - | |
10496 | | - | |
10497 | | - | |
10498 | | - | |
10499 | | - | |
| 10487 | + | |
| 10488 | + | |
| 10489 | + | |
| 10490 | + | |
| 10491 | + | |
| 10492 | + | |
| 10493 | + | |
| 10494 | + | |
10500 | 10495 | | |
10501 | 10496 | | |
10502 | 10497 | | |
| |||
0 commit comments