hermes - 💡(How to fix) Fix fix(tui): Cmd+C over SSH kills the agent (splits PR #20421) [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

On macOS-over-SSH running hermes --tui, pressing Cmd+C (muscle memory for "copy selection") kills the agent because the TUI treats the forwarded modifier as Ctrl+C → interrupt. The user-visible symptom is: select text, hit Cmd+C to copy, agent exits.

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Problem

On macOS-over-SSH running hermes --tui, pressing Cmd+C (muscle memory for "copy selection") kills the agent because the TUI treats the forwarded modifier as Ctrl+C → interrupt. The user-visible symptom is: select text, hit Cmd+C to copy, agent exits.

PR #20421 tried to fix this plus several other things in one go. Review in #20421 requested a split — this issue tracks the minimum fix.

Prompt to Recreate

  1. Local terminal: iTerm2 (or any terminal that forwards Cmd+C over SSH).
  2. SSH to a host running Hermes.
  3. hermes --tui.
  4. Select text in the composer.
  5. Press Cmd+C.

Expected: selection copies to the local clipboard (via OSC52 / tmux-buffer / kitty-protocol forwarding, whichever the transport supports). Actual: agent interrupts / exits.

Secondary bug on the way: on pre-kitty-keyboard iTerm2, pressing Option+C currently misclassifies as copy (because the classifier treats key.meta as Cmd), swallowing the ç character.

Scope (PR A)

  • Keep ui-tui/src/lib/terminalSignals.ts + terminalShortcuts.ts + the useInputHandlers.ts / textInput.tsx wiring from #20421.
  • Route both copy sites (input-buffer in textInput.tsx and terminal-selection in useInputHandlers.ts) through setClipboard() in @hermes/ink/termio/osc via a writeClipboardSmart helper in lib/clipboard.ts. Today useInputHandlers is smart but textInput is dumb.
  • In classifyCopyChord, require key.super === true for Cmd-shape chords. This drops literal Cmd+C support on pre-kitty-keyboard terminals (acceptable; Ctrl+Shift+C is the documented fallback) but fixes the Option+C misclassification and keeps the actual SSH case working when the outer terminal speaks kitty-protocol.
  • Ctrl+X queue-edit delete must stay independent of the shortcut classifier (Copilot comment 8).
  • Fix the non-mac help text in content/hotkeys.ts (Ctrl+C = interrupt, Ctrl+Shift+C = copy).
  • Delete terminalDoctor.ts, terminalProbe.ts, shellSignals.startupRiskHints, buildHelpHintHotkeys, updateTerminalProbe, plus their tests. These ship dead in #20421 and belong in the follow-up platform PR (tracked separately).
  • Rebase onto origin/main (currently 224 commits behind).
  • npm run lint --fix on touched files.

Non-scope

  • No probe-time capability detection. That's PR B.
  • No /doctor command. That's PR B.
  • No capability-aware help hints in helpHint.tsx. That's PR B.
  • No 21-profile registry exposed as a public API. Trim or scope internal.

Acceptance

  • npm run lint clean on touched files.
  • npm test green on terminalSignals, terminalShortcuts, clipboard, and the existing voice-shortcut / paste-path tests.
  • Manual matrix (iTerm2 local / → tmux / → SSH / → SSH → tmux): Cmd+C with selection copies; Cmd+C without selection no-ops; Ctrl+C interrupts; Option+C inserts ç.

Context

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING