Skip to content

Commit b70b2fa

Browse files
bebe
authored andcommitted
Fix Option+Backspace word deletion in Ghostty
Add 'backspace' to default input_delete_word_backward keybinding to support terminals like Ghostty where Option+Backspace sends the same sequence as regular backspace (DEL/0x7f). This enables Option+Backspace to work in Ghostty, though it means regular backspace will also delete words in such terminals. This is a necessary tradeoff for compatibility with terminals that don't distinguish between Option+Backspace and regular backspace. Keybindings now include: ctrl+w, ctrl+backspace, alt+backspace, backspace Note: Kitty keyboard protocol approach was tested but Ghostty does not use CSIu encoding for Option+Backspace, so this simpler keybinding approach is used instead. Closes anomalyco#3364
1 parent 5be679f commit b70b2fa

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/opencode/src/cli/cmd/tui/app.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export function tui(input: { url: string; args: Args; onExit?: () => Promise<voi
146146
targetFps: 60,
147147
gatherStats: false,
148148
exitOnCtrlC: false,
149-
useKittyKeyboard: { events: true },
149+
useKittyKeyboard: {},
150150
},
151151
)
152152
})

‎packages/opencode/src/config/config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ export namespace Config {
545545
input_delete_word_backward: z
546546
.string()
547547
.optional()
548-
.default("ctrl+w,ctrl+backspace,alt+backspace")
548+
.default("ctrl+w,ctrl+backspace,alt+backspace,backspace")
549549
.describe("Delete word backward in input"),
550550
history_previous: z.string().optional().default("up").describe("Previous history item"),
551551
history_next: z.string().optional().default("down").describe("Next history item"),

0 commit comments

Comments
 (0)