Skip to content

fix(cli): remove invalid ctrl-shift-c keybinding - #19907

Closed
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:fix/cli-remove-invalid-csc-keybinding
Closed

fix(cli): remove invalid ctrl-shift-c keybinding#19907
helix4u wants to merge 1 commit into
NousResearch:mainfrom
helix4u:fix/cli-remove-invalid-csc-keybinding

Conversation

@helix4u

@helix4u helix4u commented May 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the @kb.add('c-S-c') prompt_toolkit binding that crashes Hermes startup with Error: Invalid key: c-S-c.

The handler was a no-op intended to let terminals handle Ctrl+Shift+C. Because prompt_toolkit rejects that key spec on affected installs, registering it aborts CLI startup before the prompt opens. Removing it preserves terminal-native copy behavior and avoids registering an invalid key.

This is an alternative to #19895. That PR keeps the binding behind try/except; this PR removes the no-op binding entirely and adds a regression test that validates literal CLI keybindings against prompt_toolkit.

Related Issue

Fixes #19894
Fixes #19896
Fixes #19903

Related: #19895
Regression introduced by #19884

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • cli.py: removed the invalid no-op c-S-c binding.
  • tests/cli/test_cli_keybindings.py: added a regression test that parses literal @kb.add(...) decorators in cli.py and verifies prompt_toolkit can register them.

How to Test

  1. On an affected checkout, run hermes; before this fix it exits during startup with Error: Invalid key: c-S-c.
  2. Run .venv/bin/python -m py_compile cli.py.
  3. Run scripts/run_tests.sh tests/cli/test_cli_keybindings.py -q.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Linux / WSL

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

Validation run locally:

.venv/bin/python -m py_compile cli.py
scripts/run_tests.sh tests/cli/test_cli_keybindings.py -q

1 passed in 2.96s

@helix4u

helix4u commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #19895. The existing PR already covers the c-S-c startup crash; this branch was a narrower remove-the-binding variant with a regression test, but we do not need a second PR for the same issue.

@helix4u helix4u closed this May 4, 2026
@helix4u
helix4u deleted the fix/cli-remove-invalid-csc-keybinding branch May 4, 2026 21:01
@alt-glitch alt-glitch added comp/cli CLI entry point, hermes_cli/, setup wizard P1 High — major feature broken, no workaround type/bug Something isn't working labels May 4, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix for #19894 — same approach as #19902 and #19906 (remove invalid c-S-c binding entirely). Closed in favor of other PRs.

1 similar comment
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix for #19894 — same approach as #19902 and #19906 (remove invalid c-S-c binding entirely). Closed in favor of other PRs.

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 P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

2 participants