mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
fix(tui): stop ctrl+x from leaking a literal 'x' into the composer
The text input's ctrl-passthrough whitelist only listed Ctrl+C and Ctrl+B. Ctrl+X fell through to the printable-char branch and got inserted as 'x' alongside the queue-delete action firing in useInputHandlers. Add Ctrl+X to the same whitelist so it bypasses the readline-style fallback and reaches the app-level handler unchanged. When not in queue-edit mode it's a no-op, which is fine — typing 'x' on Ctrl+X was the wrong default anyway.
This commit is contained in:
@@ -684,13 +684,13 @@ export function TextInput({
|
||||
return
|
||||
}
|
||||
|
||||
// Ctrl+B is the documented voice-recording toggle (see platform.ts →
|
||||
// isVoiceToggleKey). Pass it through so the app-level handler in
|
||||
// useInputHandlers receives it instead of being swallowed here as
|
||||
// either backward-word nav (line below) or a literal 'b' insertion.
|
||||
// Ctrl chords claimed by useInputHandlers — pass through instead of
|
||||
// letting them fall into readline-style nav or a literal char insert.
|
||||
// Ctrl+B = voice toggle, Ctrl+X = delete queued message while editing.
|
||||
if (
|
||||
(k.ctrl && inp === 'c') ||
|
||||
(k.ctrl && inp === 'b') ||
|
||||
(k.ctrl && inp === 'x') ||
|
||||
k.tab ||
|
||||
(k.shift && k.tab) ||
|
||||
k.pageUp ||
|
||||
|
||||
Reference in New Issue
Block a user