Run shell command without deleting prompt
Resolved 💬 2 comments Opened Apr 12, 2026 by tom-huntington Closed Apr 13, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What variant of Codex are you using?
CLI
What feature would you like to see?
I frequently like to add context by editing the code and running !git diff
However, once I have started writing the prompt it becomes very cumbersome do run a shell command. You have to copy the prompt, delete it, run the bang command, then paste back the prompt.
Can we just run a ! bang command anytime, rather than only before writing the prompt?
Additional information
_No response_
2 Comments
Do you have any thoughts about the mechanics of this? Are you thinking that it would involve switching over to a secondary input box?
Here's a pro tip that you might not know about. You can Ctrl+C to copy and stash the current prompt, then enter a different prompt, then use the up arrow to "pop" the stashed prompt. This makes the sequence that you described above much more ergonomic.
Yes, I didn't know Ctrl+C saves the prompt. Thanks!