option delete doesn't delete word by word #3243

Closed
opened 2026-02-16 17:39:17 -05:00 by yindo · 21 comments
Owner

Originally created by @luisrudge on GitHub (Dec 1, 2025).

Originally assigned to: @kommander on GitHub.

Description

it was working until last week

OpenCode version

1.0.126

Steps to reproduce

type a few words in macos. press option + delete to delete a word, it only deletes a character.

Screenshot and/or share link

No response

Operating System

mac

Terminal

ghostty

Originally created by @luisrudge on GitHub (Dec 1, 2025). Originally assigned to: @kommander on GitHub. ### Description it was working until last week ### OpenCode version 1.0.126 ### Steps to reproduce type a few words in macos. press option + delete to delete a word, it only deletes a character. ### Screenshot and/or share link _No response_ ### Operating System mac ### Terminal ghostty
yindo added the opentuibug labels 2026-02-16 17:39:17 -05:00
yindo closed this issue 2026-02-16 17:39:17 -05:00
Author
Owner

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

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

  • #436: cmd+delete, option+delete - Feature request for these exact macOS keyboard shortcuts
  • #1167: Feature Request: Support Ctrl+Backspace and Ctrl+Delete for Word Deletion in TUI - Similar word deletion feature request
  • #4938: Keyboard shortcuts to edit prompts suck so much! - Broader issue covering keyboard shortcut problems including word deletion

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

@github-actions[bot] commented on GitHub (Dec 1, 2025): This issue might be a duplicate of existing issues. Please check: - #436: cmd+delete, option+delete - Feature request for these exact macOS keyboard shortcuts - #1167: Feature Request: Support Ctrl+Backspace and Ctrl+Delete for Word Deletion in TUI - Similar word deletion feature request - #4938: Keyboard shortcuts to edit prompts suck so much! - Broader issue covering keyboard shortcut problems including word deletion Feel free to ignore if none of these address your specific case.
Author
Owner

@luisrudge commented on GitHub (Dec 1, 2025):

interesting.. it works in vscode's (cursor's) terminal. but it doesn't work in ghostty or macos terminal

@luisrudge commented on GitHub (Dec 1, 2025): interesting.. it works in vscode's (cursor's) terminal. but it doesn't work in ghostty or macos terminal
Author
Owner

@kommander commented on GitHub (Dec 15, 2025):

macos terminal before Tahoe does not support modifyOtherKeys, so it won't work there, but behaviour should be better in the latest version and option+delete and option+backspace are now mapped to by-word actions by default.

@kommander commented on GitHub (Dec 15, 2025): macos terminal before Tahoe does not support modifyOtherKeys, so it won't work there, but behaviour should be better in the latest version and `option+delete` and `option+backspace` are now mapped to by-word actions by default.
Author
Owner

@luisrudge commented on GitHub (Dec 15, 2025):

@kommander do you mean in opencode or on opentui (meaning we need to wait for an update in OC with the new opentui version)? Asking it because it's still not fixed in 1.0.161

@luisrudge commented on GitHub (Dec 15, 2025): @kommander do you mean in opencode or on opentui (meaning we need to wait for an update in OC with the new opentui version)? Asking it because it's still not fixed in 1.0.161
Author
Owner

@kommander commented on GitHub (Dec 15, 2025):

Where doesn't it work?

@kommander commented on GitHub (Dec 15, 2025): Where doesn't it work?
Author
Owner

@luisrudge commented on GitHub (Dec 15, 2025):

opencode terminal text area

@luisrudge commented on GitHub (Dec 15, 2025): opencode terminal text area
Author
Owner

@supnim commented on GitHub (Dec 15, 2025):

just to note: option + backspace works in claude code via ghostty

@supnim commented on GitHub (Dec 15, 2025): just to note: option + backspace works in claude code via ghostty
Author
Owner

@kommander commented on GitHub (Dec 16, 2025):

@luisrudge @supnim what is in your opencode configs? Custom or default?

@kommander commented on GitHub (Dec 16, 2025): @luisrudge @supnim what is in your opencode configs? Custom or default?
Author
Owner

@supnim commented on GitHub (Dec 16, 2025):

default boss

@supnim commented on GitHub (Dec 16, 2025): default boss
Author
Owner

@kommander commented on GitHub (Dec 16, 2025):

I cannot reproduce this, option+backspace deletes the word before the cursor and option+delete deletes the word after the cursor as expected. Did something mess with the Ghostty config?

@kommander commented on GitHub (Dec 16, 2025): I cannot reproduce this, option+backspace deletes the word before the cursor and option+delete deletes the word after the cursor as expected. Did something mess with the Ghostty config?
Author
Owner

@luisrudge commented on GitHub (Dec 16, 2025):

default opencode config

ghostty config:

keybind = shift+enter=text:\n
confirm-close-surface=false
working-directory = ~/Developer/
@luisrudge commented on GitHub (Dec 16, 2025): default opencode config ghostty config: ``` keybind = shift+enter=text:\n confirm-close-surface=false working-directory = ~/Developer/ ```
Author
Owner

@luisrudge commented on GitHub (Dec 16, 2025):

interesting that I can navigate with option + arrow left/right and it navigates correctly. it's only an issue if I'm deleting text

@luisrudge commented on GitHub (Dec 16, 2025): interesting that I can navigate with option + arrow left/right and it navigates correctly. it's only an issue if I'm deleting text
Author
Owner

@supnim commented on GitHub (Dec 16, 2025):

ghostty config:

theme = dark:"Material Darker",light:"Violet Light"
window-inherit-working-directory = true
fullscreen = true
working-directory = /Users/nimesh/Code/aiagent
unfocused-split-opacity = 1
keybind = shift+enter=text:\n

Okay, I messed around a bit more, and found thatctrl + backspacedoes the behaviour of what i except option + backspace to do.

ps. im on a mac

@supnim commented on GitHub (Dec 16, 2025): ghostty config: ``` theme = dark:"Material Darker",light:"Violet Light" window-inherit-working-directory = true fullscreen = true working-directory = /Users/nimesh/Code/aiagent unfocused-split-opacity = 1 keybind = shift+enter=text:\n ``` Okay, I messed around a bit more, and found that` ctrl + backspace `does the behaviour of what i except `option + backspace` to do. ps. im on a mac
Author
Owner

@aryaMode commented on GitHub (Dec 20, 2025):

Setting up my ghostty config up like this worked for me:

macos-option-as-alt = true
keybind = alt+backspace=text:\x1b\x7f
keybind = alt+delete=esc:d

@aryaMode commented on GitHub (Dec 20, 2025): Setting up my ghostty config up like this worked for me: `macos-option-as-alt = true` `keybind = alt+backspace=text:\x1b\x7f` `keybind = alt+delete=esc:d`
Author
Owner

@luisrudge commented on GitHub (Dec 22, 2025):

macos-option-as-alt = true

this works. really unfortunate that opencode doesn't work with the default options, though.

@luisrudge commented on GitHub (Dec 22, 2025): ``` macos-option-as-alt = true ``` this works. really unfortunate that opencode doesn't work with the default options, though.
Author
Owner

@supnim commented on GitHub (Dec 26, 2025):

Setting up my ghostty config up like this worked for me:

macos-option-as-alt = true keybind = alt+backspace=text:\x1b\x7f keybind = alt+delete=esc:d

this worked for me! thank you

@supnim commented on GitHub (Dec 26, 2025): > Setting up my ghostty config up like this worked for me: > > `macos-option-as-alt = true` `keybind = alt+backspace=text:\x1b\x7f` `keybind = alt+delete=esc:d` this worked for me! thank you
Author
Owner

@valtism commented on GitHub (Dec 27, 2025):

@kommander I think this is still an issue and should be reopened. It does not work by default for me with MacOS and Ghostty

@valtism commented on GitHub (Dec 27, 2025): @kommander I think this is still an issue and should be reopened. It does not work by default for me with MacOS and Ghostty
Author
Owner

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

What version of ghostty are you on, im on macos and default ghostty (v1.2.3) cannot replicate issue

@rekram1-node commented on GitHub (Dec 27, 2025): What version of ghostty are you on, im on macos and default ghostty (v1.2.3) cannot replicate issue
Author
Owner

@valtism commented on GitHub (Dec 27, 2025):

MacOS 26.1 and Ghostty tip (commit 669733d59 build 13319) tested with default config

opt + backspace just does a single backspace. cmd + backspace works (deletes entire line)

@valtism commented on GitHub (Dec 27, 2025): MacOS 26.1 and Ghostty tip (commit [669733d59](https://github.com/ghostty-org/ghostty/commits/669733d59) build 13319) tested with default config `opt` + `backspace` just does a single backspace. `cmd` + `backspace` works (deletes entire line)
Author
Owner

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

I have the issue with MacOS v26.1, OpenCode v1.0.206, and Ghostty v1.2.3.

ctrl+backspace and ctrl+w works to delete word backwards, and opt+delete (i.e. fn+opt+backspace) works to delete word forward. But opt+backpsace does not delete word backwards.

@jakst commented on GitHub (Dec 28, 2025): I have the issue with MacOS v26.1, OpenCode v1.0.206, and Ghostty v1.2.3. `ctrl+backspace` and `ctrl+w` works to delete word backwards, and `opt+delete` (i.e. `fn+opt+backspace`) works to delete word forward. But `opt+backpsace` does not delete word backwards.
Author
Owner

@slimewell commented on GitHub (Feb 7, 2026):

I opened #8645 which fixes the TUI-side deletion UX discussed here:

  • opt+backspace deletes one word backward without incorrectly swallowing line boundaries
  • cmd+backspace deletes to line start, and a second press at line start removes the previous newline
@slimewell commented on GitHub (Feb 7, 2026): I opened #8645 which fixes the TUI-side deletion UX discussed here: - `opt+backspace` deletes one word backward without incorrectly swallowing line boundaries - `cmd+backspace` deletes to line start, and a second press at line start removes the previous newline
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3243