You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Option + backspace does not delete the last word #4341
So have you also found a solution to selecting. When using cmd+a it selects the whole chat. cmd+shift+arrow doesn't seem to work even when setting it in terminal/cursor shortcuts. Does this work differently for you?
@camc314, thanks for the analysis. Have you done any testing with other terminal emulator apps? We need to ensure broad compatibility across many terminals on all supported platforms, which is what makes issues like this difficult.
This is a limitation of how Terminal.app handles this key combination.
In Terminal.app:
Open Terminal → Settings (or Preferences)
Go to Profiles → Keyboard
Check "Use Option as Meta key"
This makes Option+Backspace send ESC + Backspace (\x1b\x7f) instead of just Backspace (\x7f). Most shells interpret that as "delete word backward."
If you only want to remap that specific combo (without making Option a full Meta key), you can add a custom mapping in the same Keyboard tab:
Click the + button
Set the key to Delete with the Option modifier
Set the action to "Send text:"
Click the empty field
Type Esc first, it will add "\033" to the field
Then type Delete (or Backspace on non-Apple/external keyboards), it will add "\177" to the field
Click OK
The "Use Option as Meta key" approach is simpler but changes the behavior of all Option+key combos. The custom mapping approach is surgical — it only affects Option+Backspace.
In Codex CLI 0.167.0, Option+Backspace (Alt+Backspace) and Ctrl+W are both bound to delete the previous word. If Option+Backspace still deletes one character, run /keymap debug and press it once. Plain backspace would explain the single-character deletion. If the inspector shows alt-backspace and editor.delete_backward_word, but the composer still deletes only one character, please share the inspector output and your Codex and terminal versions. Default editor bindings
For Ghostty, the reporter confirmed this explicit binding works:
keybind = alt+backspace=text:\x1b\x7f
In Apple Terminal, try enabling Settings → Profiles → Keyboard → Use Option as Meta key. Ctrl+W is also available if you prefer to keep your terminal settings as they are.
Activity
markusylisiurunen commentedon Sep 27, 2025
Most of the other common text editing shortcuts work as expected:
option+left/right arrowmoves the cursor one word at a time.cmd+left/right arrowmoves the cursor to the beginning or end of line.cmd+backspacedeletes the entire line.markusylisiurunen commentedon Sep 27, 2025
There actually seems to be a test case in place for this exact key combination:
codex/codex-rs/tui/src/bottom_pane/textarea.rs
Line 1246 in 5c67dc3
Codex works as expected when I explicitly set Ghostty keybinding to this:
Perhaps the issue is that the
ALTmodifier is not somehow either passed or parsed correctly.Schreezer commentedon Oct 5, 2025
thanks a lot for the solution 'Codex works as expected when I explicitly set Ghostty keybinding to this:
keybind = alt+backspace=text:\x1b\x7f' ; both codex and qwen are working as expected now
Cornelivl commentedon Dec 10, 2025
So have you also found a solution to selecting. When using cmd+a it selects the whole chat. cmd+shift+arrow doesn't seem to work even when setting it in terminal/cursor shortcuts. Does this work differently for you?
camc314 commentedon Jan 29, 2026
Ok,I debugged into this, and here's what I found.
on macos:
Here's a patch that fixes ths issue (codex's contributing.md doesn't allow external PRs without permission)
patch.diff
This paatch aligns the behaviour with browsers/other CLI worlkflows.
EDIT: somehow after fixing and testing the patch, it's working now in some of my codex instances - but not others 🤷
etraut-openai commentedon Jan 29, 2026
@camc314, thanks for the analysis. Have you done any testing with other terminal emulator apps? We need to ensure broad compatibility across many terminals on all supported platforms, which is what makes issues like this difficult.
camc314 commentedon Jan 29, 2026
I've tried https://ghostty.org and VSCode, and both appear to have the same behaviour.
Apple's terminal doesn't appear to send the key modifiers to the TUI (in here, the modifiers are always empty)
Here are some other references that might be helpful:
fcoury commentedon Feb 19, 2026
This is a limitation of how Terminal.app handles this key combination.
In Terminal.app:
This makes Option+Backspace send ESC + Backspace (\x1b\x7f) instead of just Backspace (\x7f). Most shells interpret that as "delete word backward."
If you only want to remap that specific combo (without making Option a full Meta key), you can add a custom mapping in the same Keyboard tab:
The "Use Option as Meta key" approach is simpler but changes the behavior of all Option+key combos. The custom mapping approach is surgical — it only affects Option+Backspace.
jgarvin commentedon Mar 27, 2026
I can confirm that:
kittyterminal on linux using ctrl+backspace (backward delete word) and ctrl+shift+backspace (forward delete word)costular commentedon Apr 10, 2026
I confirm it's happening on Ghostty
etraut-openai commentedon Nov 9, 2026
(response from codex)
In Codex CLI 0.167.0,
Option+Backspace(Alt+Backspace) andCtrl+Ware both bound to delete the previous word. IfOption+Backspacestill deletes one character, run/keymap debugand press it once. Plainbackspacewould explain the single-character deletion. If the inspector showsalt-backspaceandeditor.delete_backward_word, but the composer still deletes only one character, please share the inspector output and your Codex and terminal versions. Default editor bindingsFor Ghostty, the reporter confirmed this explicit binding works:
In Apple Terminal, try enabling Settings → Profiles → Keyboard → Use Option as Meta key.
Ctrl+Wis also available if you prefer to keep your terminal settings as they are.