fix(cli): fix shortcut config conflict in hermes_cli#16183
Closed
0xharryriddle wants to merge 3 commits into
Closed
fix(cli): fix shortcut config conflict in hermes_cli#161830xharryriddle wants to merge 3 commits into
0xharryriddle wants to merge 3 commits into
Conversation
- Document selection-aware Ctrl+C behavior in TUI hotkeys help - Add CHANGELOG.md entry describing the Ctrl+C copy/interrupt separation fix - TUI already implements correct copy-when-selected behavior; documentation clarifies platform specifics - cli.py and hermes_cli/config.py changes were committed separately in fix(cli): fix shortcut config conflict
1 task
Contributor
|
Salvaged via #19884 onto current main. Main had added a separate |
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?
Fixes the Ctrl+C copy/interrupt conflict in the Hermes CLI by separating copy and interrupt actions into distinct keyboard shortcuts. Previously, Ctrl+C was hard-bound to interrupt, making it impossible to use standard terminal copy shortcuts (Ctrl+Shift+C on Linux/Windows, Cmd+C on macOS) without stopping the agent.
The TUI already handled this correctly by checking for text selection before triggering interrupt. This PR brings the CLI to parity with configurable platform-aware defaults.
Related Issue
Fixes #16181
Type of Change
Changes Made
Core fix (CLI)
cli.py: Added two new keybindings:@kb.add('c-S-c')→handle_ctrl_shift_c(empty handler; defers to terminal emulator's native copy)@kb.add('c-q')→handle_ctrl_q(alternative interrupt/exit, calls_signal_handler)handle_ctrl_c(bound toc-c) remains the primary interrupt shortcutConfiguration
hermes_cli/config.py: Addeddisplay.copy_shortcutoption with values:auto(default): platform-aware — non-macOS uses Ctrl+Shift+C for copy; macOS uses Cmd+C (terminal-native)ctrl_c: Ctrl+C performs copy (not recommended; still available for power users)ctrl_shift_c: Ctrl+Shift+C always copy, Ctrl+C always interrupt (explicit non-macOS mode)disabled: no change to legacy behavior (Ctrl+C interrupt only)Documentation
ui-tui/src/content/hotkeys.ts: Documented selection-aware Ctrl+C behavior in TUI (copy when text selected, else interrupt)How to Test
hermesdisplay.copy_shortcutin config to test other modes (e.g.,ctrl_c) and verify behavior changes accordinglyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/A (AGENTS.md updated; TUI hotkeys.ts updated)cli-config.yaml.exampleif I added/changed config keys — or N/A (config.py default added; example file may need separate update)CONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Before (Ctrl+C interrupt blocking copy):
After (Ctrl+Shift+C copies without interrupt; Ctrl+C still available as interrupt):