codex icon indicating copy to clipboard operation
codex copied to clipboard

Support Option+backspace to delete previous word

Open renanliberato opened this issue 10 months ago • 7 comments

What version of Codex is running?

0.80.0

What subscription do you have?

Plus

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Darwin 23.6.0 arm64 arm

What issue are you seeing?

When I press Option+Backspace, instead of deleting a whole word like on other apps, codex deletes just a character, making it painfully slow to rewrite sentences

What steps can reproduce the bug?

type a phrase like "hello world" and hit Option+Backspace. The typed text becomes "hello worl".

What is the expected behavior?

It should become "hello ", deleting the whole word.

Additional information

No response

renanliberato avatar Jan 13 '26 19:01 renanliberato

Hi @etraut-openai nice to meet you May I work on this issue? Thank you

fury0928 avatar Jan 13 '26 19:01 fury0928

Oh damn, you guys are fast. I started working on it yesterday after opening the issue but needed to rent a machine with better spects to be able to build/test it today, after work 😅 fork commit

renanliberato avatar Jan 14 '26 13:01 renanliberato

On the face of it, this sounds like an easy bug to fix, but it turns out to be quite complex. Please refer to this thread for additional details.

etraut-openai avatar Jan 14 '26 21:01 etraut-openai

@renanliberato haha yeah, you were fast too 😅 turns out macOS Terminal.app doesn’t actually report Option or Option+Shift for Backspace at all, so Codex can’t see the combo and the fix needs deeper terminal level investigation.

senkushal avatar Jan 14 '26 22:01 senkushal

Ok, after reading the new threads and doing some web search about MacOS terminal relationship with modifiers (like this crossterm issue), I'm convinced it's more a terminal setup issue than Codex itself.

When running codex CLI via Terminal.app the word deletion works as long as "Use Option as Meta key" is enabled in the app settings.

The wrong behaviour I was seeing was because I was running codex CLI via Ghostty, but it started working as soon as I added "macos-option-as-alt = left" to the config file (learned about it here).

IIRC Claude Code has some FTUE that manipulate the terminal keybindings/settings to work well with the app, but not sure if you guys want to do something like that on Codex (like suggesting to enable these options if they're disabled etc)

renanliberato avatar Jan 14 '26 23:01 renanliberato

Feel free to close as it's not a bug itself as I initially thought 🙇‍♂️

renanliberato avatar Jan 15 '26 02:01 renanliberato

I agree it's not the the codex keybinding issue, i had same problems with iTerm 2 but it was the profile issue at my end. @etraut-openai please feel free to close this issue it is solved from my end. @renanliberato Thank you for your feedback

senkushal avatar Jan 15 '26 20:01 senkushal