fix(cli): remove invalid ctrl-shift-c keybinding - #19907
Closed
helix4u wants to merge 1 commit into
Closed
Conversation
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. |
Collaborator
1 similar comment
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Removes the
@kb.add('c-S-c')prompt_toolkit binding that crashes Hermes startup withError: 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
Changes Made
cli.py: removed the invalid no-opc-S-cbinding.tests/cli/test_cli_keybindings.py: added a regression test that parses literal@kb.add(...)decorators incli.pyand verifies prompt_toolkit can register them.How to Test
hermes; before this fix it exits during startup withError: Invalid key: c-S-c..venv/bin/python -m py_compile cli.py.scripts/run_tests.sh tests/cli/test_cli_keybindings.py -q.Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Validation run locally: