mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-16 04:22:36 +00:00
fix(tui): honor client copy shortcut over ssh
- 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
This commit is contained in:
parent
283c8fd6e2
commit
bcc5362432
4 changed files with 48 additions and 10 deletions
|
|
@ -1,15 +1,21 @@
|
|||
import { isMac } from '../lib/platform.js'
|
||||
|
||||
const isRemoteShell = Boolean(process.env.SSH_CONNECTION || process.env.SSH_CLIENT || process.env.SSH_TTY)
|
||||
const action = isMac ? 'Cmd' : 'Ctrl'
|
||||
const paste = isMac ? 'Cmd' : 'Alt'
|
||||
|
||||
const copyHotkeys: [string, string][] = isMac
|
||||
? [
|
||||
['Cmd+C', 'copy selection'],
|
||||
['Ctrl+C', 'interrupt / clear draft / exit']
|
||||
]
|
||||
: [
|
||||
...(isRemoteShell ? ([['Cmd+C', 'copy selection when forwarded by the terminal']] as [string, string][]) : []),
|
||||
['Ctrl+C', 'copy selection / interrupt / clear draft / exit']
|
||||
]
|
||||
|
||||
export const HOTKEYS: [string, string][] = [
|
||||
...(isMac
|
||||
? ([
|
||||
['Cmd+C', 'copy selection'],
|
||||
['Ctrl+C', 'interrupt / clear draft / exit']
|
||||
] as [string, string][])
|
||||
: ([['Ctrl+C', 'copy selection / interrupt / clear draft / exit']] as [string, string][])),
|
||||
...copyHotkeys,
|
||||
[action + '+D', 'exit'],
|
||||
[action + '+G', 'open $EDITOR for prompt'],
|
||||
[action + '+L', 'new session (clear)'],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue