Feature request: Use Down Arrow to temporarily clear and restore the current prompt
What variant of Codex are you using?
CLI
What feature would you like to see?
Summary
Add shell-style prompt navigation in Codex CLI so that pressing the Down Arrow while editing a non-empty prompt temporarily clears it. This would allow the user to run a slash command, then press Up Arrow to restore the original prompt.
Motivation
While composing a longer prompt, I sometimes need to run a slash command such as /help, /model, or another /command before submitting it.
Currently, doing this requires manually clearing or cutting the prompt, running the command, and then reconstructing or pasting the original text.
A more efficient workflow would be:
- Type a prompt.
- Press Down Arrow to move to a temporary empty input.
- Run a
/command. - Press Up Arrow to return to the unfinished prompt.
- Continue editing or submit it.
This would feel similar to shell history navigation while preserving the current draft.
Proposed behavior
When the input contains an unfinished prompt:
- Pressing Down Arrow at the newest history position clears the visible input.
- The unfinished prompt is retained as a temporary draft.
- The user can enter and execute one or more slash commands.
- Pressing Up Arrow restores the retained prompt.
- The draft should remain editable after restoration.
Example
> Refactor the authentication flow and add tests for...
Press Down Arrow:
>
Run a command:
> /model
After the command completes, press Up Arrow:
> Refactor the authentication flow and add tests for...
Expected history behavior
The temporary draft should behave as the newest entry in the input-history stack without being treated as a submitted prompt.
Possible navigation order:
Older submitted prompt
Current unfinished draft
Empty input
Pressing Up Arrow from the empty input would restore the draft. Pressing it again would navigate to older submitted prompts.
Additional considerations
- Avoid losing the draft when a slash command is executed.
- Preserve cursor position where practical.
- Define behavior for multiline prompts.
- Do not add the temporary draft to persistent command history unless it is submitted.
- Existing Up/Down Arrow behavior for navigating multiline text should take precedence when the cursor can still move vertically within the current input.
Additional information
_No response_