Add Word-wise Deletion in TUI

Resolved 💬 4 comments Opened Sep 8, 2025 by ajamous Closed Sep 11, 2025
💡 Likely answer: A maintainer (pakrym-oai, contributor) responded on this thread — see the highlighted reply below.

Summary
In Codex CLI on macOS, pressing Option+Delete (⌥⌫) currently deletes only a single character. This diverges from expected macOS behavior, where ⌥⌫ deletes the previous word and accelerates when held.

Current Behavior

  • ⌥⌫ deletes one character at a time.
  • No support for word-wise deletion or fast repeat while held.

Expected Behavior

  • ⌥⌫ deletes the previous word.
  • Holding the keys rapidly deletes multiple words (sentence-level speed), consistent with native macOS editors and tools like Claude Code.

Motivation
Word-wise deletion is a standard editing shortcut on macOS. Adding it to Codex CLI improves text editing efficiency and aligns with user expectations.

Steps to Reproduce

  1. On macOS (Terminal.app or iTerm2), launch Codex CLI.
  2. Type a sentence in the input field.
  3. Press Option+Delete (⌥⌫).
  4. Observe that only a single character is deleted.

Environment

  • macOS Sonoma/Sequoia (14/15)
  • Codex CLI (TUI): latest

Are you interested in implementing this feature?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

pakrym-oai contributor · 11 months ago

On iTerm, have you tried adding "Natural text editing text preset"?

<img width="1077" height="678" alt="Image" src="https://github.com/user-attachments/assets/4d99fa4a-c54c-4ec1-9ac8-8e3a0e09aa00" />

Does word-wise deletion work in other apps in the terminal?

rben01 contributor · 11 months ago

In Terminal.app, settings > profiles > keyboard > "use option as meta" — is this enabled? I think it has to be for opt-delete to delete a whole word.

ajamous · 11 months ago

This issue has been resolved in the latest codex cli version. Thanks!

ekabravo · 11 months ago

In case someone like me is using Ghostty and thought it's the Codex CLI responsible for the issue. Recent version of Ghostty changes default behavior, and we need to make a workaround:

https://github.com/ghostty-org/ghostty/discussions/8677