Skip to content

fix(cli): remove invalid 'c-S-c' key binding crashing TUI on startup - #19902

Closed
amonkarsidhant wants to merge 1 commit into
NousResearch:mainfrom
amonkarsidhant:fix/tui-invalid-ctrl-shift-c-key
Closed

fix(cli): remove invalid 'c-S-c' key binding crashing TUI on startup#19902
amonkarsidhant wants to merge 1 commit into
NousResearch:mainfrom
amonkarsidhant:fix/tui-invalid-ctrl-shift-c-key

Conversation

@amonkarsidhant

Copy link
Copy Markdown

Summary

  • @kb.add('c-S-c') (added in 645a2f4) raises Invalid key: c-S-c from prompt_toolkit immediately after the welcome banner, making the TUI unusable on startup.
  • Terminals do not deliver Ctrl+Shift+C as a key combination distinct from Ctrl+C — the shift modifier is not transmitted for control-letter sequences in standard xterm/VT encodings — so prompt_toolkit rejects the key name.
  • The handler was a documented no-op anyway. Its sole purpose was preventing Hermes from intercepting native terminal copy, which already works without any binding because the terminal handles Ctrl+Shift+C before the application sees it.

Removing the binding restores TUI startup with no behavioral change to copy/paste.

Reproduction

$ hermes
... banner renders ...
Welcome to Hermes Agent! Type your message or /help for commands.
Error: Invalid key: c-S-c

Test plan

  • hermes starts cleanly past the welcome banner with the patch applied
  • Native terminal copy (Ctrl+Shift+C on Linux/Windows, Cmd+C on macOS) still works — was already terminal-handled
  • python -m py_compile cli.py clean

The `@kb.add('c-S-c')` registration in HermesCLI raises
`Invalid key: c-S-c` from prompt_toolkit immediately after the
welcome banner, making the TUI unusable.

Terminal emulators do not deliver Ctrl+Shift+C as a key combination
distinct from Ctrl+C (the shift modifier is not transmitted for
control-letter sequences in standard xterm/VT encodings), so
prompt_toolkit rejects the key name. The handler was a documented
no-op anyway — its sole purpose was to prevent Hermes from
intercepting native terminal copy, which already works without any
binding because the terminal handles Ctrl+Shift+C before the
application sees it.

Removing the binding restores TUI startup. Native terminal copy
behavior is unchanged.
@alt-glitch alt-glitch added type/bug Something isn't working P0 Critical — data loss, security, crash loop comp/cli CLI entry point, hermes_cli/, setup wizard labels May 4, 2026
@teknium1

teknium1 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Duplicate — the underlying bug was fixed on main before your PR landed.

Closing issue #19903 too. Thanks for jumping on it — appreciate the quick turnaround even if we only needed one of the fixes.

@teknium1 teknium1 closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P0 Critical — data loss, security, crash loop type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants