mirror of
https://github.com/stablyai/orca.git
synced 2026-09-24 16:02:41 +00:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user