From 04e85504bbc505df1a460bf43e751765aded8a2e Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 24 Mar 2026 19:02:57 -0700 Subject: [PATCH] fix: allow Option+Backspace word-delete in input fields (#89) Co-authored-by: Claude Opus 4.6 --- .../src/components/terminal-pane/keyboard-handlers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/keyboard-handlers.ts b/src/renderer/src/components/terminal-pane/keyboard-handlers.ts index 8bf4f7b9d0f..7ce428bd33a 100644 --- a/src/renderer/src/components/terminal-pane/keyboard-handlers.ts +++ b/src/renderer/src/components/terminal-pane/keyboard-handlers.ts @@ -140,6 +140,7 @@ export function useTerminalKeyboardShortcuts({ } // Ctrl+Backspace → send \x17 (backward-kill-word) to PTY. + // Skip when focus is in an input/textarea so native word-delete still works. const onCtrlBackspace = (e: KeyboardEvent): void => { if (!e.ctrlKey || e.metaKey || e.altKey || e.shiftKey) { return @@ -147,6 +148,10 @@ export function useTerminalKeyboardShortcuts({ if (e.key !== 'Backspace') { return } + const tag = (e.target as HTMLElement)?.tagName + if (tag === 'INPUT' || tag === 'TEXTAREA') { + return + } const manager = managerRef.current if (!manager) { @@ -164,6 +169,7 @@ export function useTerminalKeyboardShortcuts({ } // Alt+Backspace → send ESC + DEL (\x1b\x7f, backward-kill-word) to PTY. + // Skip when focus is in an input/textarea so native word-delete still works. const onAltBackspace = (e: KeyboardEvent): void => { if (!e.altKey || e.metaKey || e.ctrlKey || e.shiftKey) { return @@ -171,6 +177,10 @@ export function useTerminalKeyboardShortcuts({ if (e.key !== 'Backspace') { return } + const tag = (e.target as HTMLElement)?.tagName + if (tag === 'INPUT' || tag === 'TEXTAREA') { + return + } const manager = managerRef.current if (!manager) {