How to use undo and redo shortcuts in the Codex CLI composer
Starting with Codex CLI 0.171.0 (November 20), you can undo edits in the prompt composer. Long pastes and attached images you deleted by mistake come back too. It works only in the default (non-Vim) composer.
npm install -g @openai/codex@0.171.0
The default undo shortcut is Alt+Z on macOS and Linux and Ctrl+Z on Windows. F7 works everywhere, and Cmd (Super)+Z also works on macOS. Add Shift to the same key to redo.
Contiguous typing and consecutive Backspaces each group into one undo step, and a paste stays separate from the typing before it. Sending a message clears the undo history.
If your terminal or tmux grabs Alt+Z first, pick composer.undo and composer.redo in /keymap and bind other keys. The change is saved under tui.keymap.composer in config.toml.
Sources
Get notified when a new tip lands
Tip alerts only go out in the app. Install it and turn notifications on.