Bug Description
In the Hermes CLI (prompt_toolkit-based terminal interface), pressing Ctrl+C triggers an interrupt signal that stops the agent, making it impossible to use the standard terminal copy shortcut (Ctrl+C on macOS, Ctrl+Shift+C on Linux/Windows) to copy text from the terminal output. This creates a usability conflict: users cannot copy errors, logs, or agent responses without first interrupting the agent.
The TUI (xterm.js-based interface) already handles this correctly by checking if text is selected before treating Ctrl+C as an interrupt.
Steps to Reproduce
- Start Hermes in CLI mode:
hermes
- Let the agent run a task that produces output
- Try to select and copy text using the terminal emulator's copy shortcut:
- On macOS: Cmd+C (or Ctrl+C if terminal is configured)
- On Linux/Windows: Ctrl+Shift+C
- Observe that pressing the copy shortcut triggers an interrupt instead of copying
- The agent stops, and the text is not copied
Expected Behavior
- Copy shortcuts should work to copy text from the terminal without interrupting the agent
- Interrupt should still be available via a dedicated shortcut (Ctrl+C or alternative)
- Platform conventions should be respected:
- macOS: Cmd+C copies, Ctrl+C interrupts
- Linux/Windows: Ctrl+Shift+C copies, Ctrl+C interrupts
- When text is selected, copy should take precedence over interrupt (TUI already does this)
Actual Behavior
- Ctrl+C is always captured as an interrupt signal by prompt_toolkit
- Terminal emulator's native copy mechanism never receives the keystroke
- Users must interrupt the agent before they can copy text, disrupting workflow
Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
N/A (CLI only)
Debug Report
Debug report uploaded:
Report https://paste.rs/lLfqv
agent.log https://dpaste.com/3UKJPD6PB
Operating System
Ubuntu 24.04
Python Version
No response
Hermes Version
No response
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
- Add new config option
display.copy_shortcut with values: auto (platform-aware), ctrl_c, ctrl_shift_c, disabled
- Add
@kb.add('c-S-c') handler (Ctrl+Shift+C) that does nothing — allows terminal to handle copy natively
- Add
@kb.add('c-q') handler (Ctrl+Q) as alternative interrupt/exit shortcut
- Keep
@kb.add('c-c') handler as primary interrupt (config-aware: if copy_shortcut is ctrl_shift_c on non-macOS, Ctrl+C remains interrupt; if ctrl_c then Ctrl+C becomes copy and Ctrl+Q becomes interrupt)
- Update documentation (CHANGELOG.md, TUI hotkeys.ts, AGENTS.md)
Platform defaults for auto:
- macOS: Cmd+C copies (terminal-native), Ctrl+C interrupts
- Linux/Windows: Ctrl+Shift+C copies (terminal-native), Ctrl+C interrupts
- Users can override to suit their terminal emulator or preference
Are you willing to submit a PR for this?
Bug Description
In the Hermes CLI (prompt_toolkit-based terminal interface), pressing Ctrl+C triggers an interrupt signal that stops the agent, making it impossible to use the standard terminal copy shortcut (Ctrl+C on macOS, Ctrl+Shift+C on Linux/Windows) to copy text from the terminal output. This creates a usability conflict: users cannot copy errors, logs, or agent responses without first interrupting the agent.
The TUI (xterm.js-based interface) already handles this correctly by checking if text is selected before treating Ctrl+C as an interrupt.
Steps to Reproduce
hermesExpected Behavior
Actual Behavior
Affected Component
CLI (interactive chat)
Messaging Platform (if gateway-related)
N/A (CLI only)
Debug Report
Operating System
Ubuntu 24.04
Python Version
No response
Hermes Version
No response
Additional Logs / Traceback (optional)
Root Cause Analysis (optional)
No response
Proposed Fix (optional)
display.copy_shortcutwith values:auto(platform-aware),ctrl_c,ctrl_shift_c,disabled@kb.add('c-S-c')handler (Ctrl+Shift+C) that does nothing — allows terminal to handle copy natively@kb.add('c-q')handler (Ctrl+Q) as alternative interrupt/exit shortcut@kb.add('c-c')handler as primary interrupt (config-aware: if copy_shortcut isctrl_shift_con non-macOS, Ctrl+C remains interrupt; ifctrl_cthen Ctrl+C becomes copy and Ctrl+Q becomes interrupt)Platform defaults for
auto:Are you willing to submit a PR for this?