Alt+Backspace to delete word does not work #3942

Open
opened 2026-02-16 17:42:01 -05:00 by yindo · 6 comments
Owner

Originally created by @jakst on GitHub (Dec 28, 2025).

Originally assigned to: @kommander on GitHub.

Description

Keybindings for deleting word from the cursor and back are set as ctrl+w,ctrl+backspace,alt+backspace in https://github.com/sst/opencode/blob/f3febd6e395458698fceca2f175f59e0cf68c1d6/packages/opencode/src/config/config.ts#L565-L568

However, Alt+Backspace does not work, which is slightly frustrating since it's the only one of them that works in all input fields on a Mac, and hence the one that's in muscle memory for most (I would assume, at least for me).

OpenCode version

1.0.206

Steps to reproduce

  1. Type a word into opencode textarea
  2. Ensure the cursor is somewhere in the middle of the word or at the end of the word
  3. Hit Alt+Backspace
  4. Observe only one character was deleted instead of the whole word up to the cursor

Screenshot and/or share link

No response

Operating System

MacOS 26.1

Terminal

Ghostty, MacOS Terminal

Originally created by @jakst on GitHub (Dec 28, 2025). Originally assigned to: @kommander on GitHub. ### Description Keybindings for deleting word from the cursor and back are set as `ctrl+w,ctrl+backspace,alt+backspace` in https://github.com/sst/opencode/blob/f3febd6e395458698fceca2f175f59e0cf68c1d6/packages/opencode/src/config/config.ts#L565-L568 However, `Alt+Backspace` does not work, which is slightly frustrating since it's the only one of them that works in all input fields on a Mac, and hence the one that's in muscle memory for most (I would assume, at least for me). ### OpenCode version 1.0.206 ### Steps to reproduce 1. Type a word into opencode textarea 2. Ensure the cursor is somewhere in the middle of the word or at the end of the word 3. Hit `Alt+Backspace` 4. Observe only one character was deleted instead of the whole word up to the cursor ### Screenshot and/or share link _No response_ ### Operating System MacOS 26.1 ### Terminal Ghostty, MacOS Terminal
yindo added the opentuibug labels 2026-02-16 17:42:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 28, 2025):

For keybind-related issues, please also check our pinned keybinds documentation: #4997

This issue might be a duplicate of existing issues. Please check:

  • #4965: option delete doesn't delete word by word
  • #4997: Keybinds (master issue tracking multiple keybind problems including word deletion issues)

The #4997 issue documents that word deletion keybinds (option+delete, alt+d, ctrl+backspace, alt+backspace) are broken and not working reliably across different terminals and operating systems.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 28, 2025): For keybind-related issues, please also check our pinned keybinds documentation: #4997 This issue might be a duplicate of existing issues. Please check: - #4965: option delete doesn't delete word by word - #4997: Keybinds (master issue tracking multiple keybind problems including word deletion issues) The #4997 issue documents that word deletion keybinds (option+delete, alt+d, ctrl+backspace, alt+backspace) are broken and not working reliably across different terminals and operating systems. Feel free to ignore if none of these address your specific case.
Author
Owner

@jakst commented on GitHub (Dec 28, 2025):

If https://github.com/sst/opencode/issues/4965 is reopened, I can close this issue.

Workaround from that issue that works for me at the moment is this Ghostty config

keybind = alt+backspace=text:\x1b\x7f
@jakst commented on GitHub (Dec 28, 2025): If https://github.com/sst/opencode/issues/4965 is reopened, I can close this issue. Workaround from that issue that works for me at the moment is this Ghostty config ``` keybind = alt+backspace=text:\x1b\x7f ```
Author
Owner

@rekram1-node commented on GitHub (Dec 28, 2025):

I have exact same setup, and without any special modifiers this works, I cannot reproduce your bug.

This is my entire ghostty config:

keybind = cmd+b=next_tab
@rekram1-node commented on GitHub (Dec 28, 2025): I have exact same setup, and without any special modifiers this works, I cannot reproduce your bug. This is my entire ghostty config: ``` keybind = cmd+b=next_tab ```
Author
Owner

@jakst commented on GitHub (Dec 29, 2025):

Hmm strange, even with no Ghostty config at all I have the issue. I killed all processes that I could think of interfering with keyboard shortcuts, Karabiner Elements, Better Touch Tool, Raycast, Alt+Tab. No bueno.

And the shortcut works in a plain Ghostty terminal, so it's kinda weird that it stops working inside opencode.

@jakst commented on GitHub (Dec 29, 2025): Hmm strange, even with no Ghostty config at all I have the issue. I killed all processes that I could think of interfering with keyboard shortcuts, Karabiner Elements, Better Touch Tool, Raycast, Alt+Tab. No bueno. And the shortcut works in a plain Ghostty terminal, so it's kinda weird that it stops working inside opencode.
Author
Owner

@antonio-ivanovski commented on GitHub (Jan 27, 2026):

I have the same issue (Option+Backpace not deleting word), but there are some nuances

  • It does works in Ghostty and VS Code
  • It does works in opencode running in VS Code terminal
  • It does NOT work in opencode running in Ghostty terminal
  • It does NOT work in opencode running in Apple Terminal

There are the keybindings of my zsh

opencode on  dev via 🥟 v1.3.5
❯ bindkey | grep delete
"^D" delete-char-or-list
"^H" backward-delete-char
"^[[3~" delete-char
"^?" backward-delete-char

opencode on  dev via 🥟 v1.3.5
❯ bindkey | grep kill-word
"^W" backward-kill-word
"^[^H" backward-kill-word
"^[D" kill-word
"^[[3;5~" kill-word
"^[d" kill-word
"^[^?" backward-kill-word
@antonio-ivanovski commented on GitHub (Jan 27, 2026): I have the same issue (Option+Backpace not deleting word), but there are some nuances - It does works in Ghostty and VS Code - It does works in opencode running in VS Code terminal - It does NOT work in opencode running in Ghostty terminal - It does NOT work in opencode running in Apple Terminal There are the keybindings of my zsh ``` opencode on  dev via 🥟 v1.3.5 ❯ bindkey | grep delete "^D" delete-char-or-list "^H" backward-delete-char "^[[3~" delete-char "^?" backward-delete-char opencode on  dev via 🥟 v1.3.5 ❯ bindkey | grep kill-word "^W" backward-kill-word "^[^H" backward-kill-word "^[D" kill-word "^[[3;5~" kill-word "^[d" kill-word "^[^?" backward-kill-word ```
Author
Owner

@ujjwaljainnn commented on GitHub (Feb 9, 2026):

It also doesn't work in Warp terminal

@ujjwaljainnn commented on GitHub (Feb 9, 2026): It also doesn't work in Warp terminal
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3942