fix(tui): honor client copy shortcut over ssh - #15766
Conversation
- accept forwarded Cmd+C for selection copy in SSH sessions even when Hermes runs on Linux - keep local Linux Alt+C from acting as copy and update TUI hotkey hints for remote shells
There was a problem hiding this comment.
Pull request overview
This PR updates the TUI’s keybinding logic so selection-copy behaves correctly when running Hermes on a remote machine over SSH, particularly when the client terminal forwards Cmd+C as super (kitty protocol) or legacy meta.
Changes:
- Add
isCopyShortcut()to centralize copy-shortcut detection (including SSH-aware Cmd+C forwarding on non-macOS). - Wire
isCopyShortcut()into the main input handler path for selection copy behavior. - Update hotkey hint text for SSH scenarios and add unit tests for the new helper.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| ui-tui/src/lib/platform.ts | Adds SSH-aware isCopyShortcut() (and internal remote-shell detection) to unify copy-chord logic. |
| ui-tui/src/content/hotkeys.ts | Adjusts displayed hotkeys to reflect Cmd+C forwarding over SSH on non-macOS. |
| ui-tui/src/app/useInputHandlers.ts | Uses isCopyShortcut() instead of isAction(..., 'c') for copy handling. |
| ui-tui/src/tests/platform.test.ts | Adds test coverage for isCopyShortcut() across local/SSH scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Reuse the platform helper for SSH-aware copy hints so hotkey display and input handling cannot drift.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- clamp selection highlight to real row content so blank drag margins do not render or copy - keep successful copy actions quiet while preserving usage and failure feedback
Use an explicit conditional table instead of spread casting for SSH copy hint rows.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- trim only empty edge rows instead of full selected text - bound selection paint using unwritten cells so rendered indentation remains copyable
Render code indentation spaces as selectable cells so copied fenced code keeps its leading whitespace.
- add a written-cell bitmap so selection can distinguish rendered spaces from blank padding - preserve code indentation without markdown-specific rendering hacks
Keep screen.ts import ordering aligned with the ui-tui formatter.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Clamp copied selection columns to the screen width before scanning rendered cells.
fix(tui): honor client copy shortcut over ssh
fix(tui): honor client copy shortcut over ssh
fix(tui): honor client copy shortcut over ssh
fix(tui): honor client copy shortcut over ssh
Summary
/copypicker feature and Feat/dashboard chat #13379 is dashboard/xterm copy work; neither directly fixes TUI selection copy shortcuts over SSH.super/legacymeta) copies selections during SSH sessions even when Hermes runs on remote Linux.Test plan
npm run fix && npm run type-check(inui-tui)npm run type-check(inui-tui)npm test -- src/__tests__/platform.test.ts src/__tests__/createSlashHandler.test.ts(inui-tui)npm test -- packages/hermes-ink/src/ink/selection.test.ts src/__tests__/platform.test.ts(inui-tui)npm test -- packages/hermes-ink/src/ink/selection.test.ts src/__tests__/platform.test.ts src/__tests__/createSlashHandler.test.ts(inui-tui)npm test -- src/__tests__/markdown.test.ts packages/hermes-ink/src/ink/selection.test.ts(inui-tui)npm test -- packages/hermes-ink/src/ink/selection.test.ts src/__tests__/markdown.test.ts src/__tests__/platform.test.ts src/__tests__/createSlashHandler.test.ts(inui-tui)