Undo / redo typing
Open 💬 8 comments Opened Aug 16, 2025 by aehlke
What feature would you like to see?
Cmd-Z / Shift-Cmd-Z to undo/redo entered text in a prompt
Are you interested in implementing this feature?
_No response_
Additional information
_No response_
8 Comments
Bonus:
/undoand/redocommands in OpenCode (TUI) not only rewind the chat, but also revert/restore any file changes.https://opencode.ai/docs/tui/#undo
please implement readline/emacs style undo (C-/ or C-_) and redo (C-?) since most readline keys appear to be implemented already.
there does not appear to be any way to undo right now.
+1 Undo/redo typing support would be very helpful, especially in terminal environments where Cmd+Z gets intercepted.
Agree, sometimes it is really frustrating when you accidentally delete a line of prompt... it's completely usable right now but it'd be better to have it.
Any form of undo / redo in the text editor would be fantastic!
I just whacked the entire prompt I had written and was pissed but asked codex about it and since I'm in linux/bash and had used ctrl+K it said duh use ctrl+y. Saved me some blood pressure, passing it along, worked great.
Awesome, it works as well for ctrl-u, ctrl-c, etc.
I have a candidate implementation of undo/redo in the TUI composer against latest (0.180.alpha) Codex CLI, so you can build your own patched Codex.
Big quality of life improvement esp. with multiple pastes. You can undo pastes even if you typed something after. It undoes Ctrl+C clear and you can keep undoing after that. So an accidental Ctrl+V, then Ctrl+C presses can still be recovered from. Ctrl+Z/Ctrl+Shift+Z on Windows, Alt+Z/Alt+Shift+Z on Unix/Mac.
Happy to open a PR or just provide an inspiration for implementation.