fix: allow Option+Backspace word-delete in input fields (#89)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Neil
2026-03-24 19:02:57 -07:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 53ce1c06b0
commit 04e85504bb
@@ -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) {