Vim mode: Ctrl+C clears the prompt instead of exiting Insert mode
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
Vim mode in the Codex CLI does not support Ctrl+C as a way to leave Insert mode and return to Normal mode. Instead, pressing Ctrl+C clears the entire prompt. When an agent turn is running, it can also cancel the turn.
The missing mode transition affects ordinary prompt editing even when the agent is idle, not just editing during an active turn.
Steps to reproduce
- Enable Vim mode in the interactive Codex CLI.
- Enter Insert mode in the composer and type a prompt without submitting it.
- Press
Ctrl+C, expecting to return to Normal mode. - Observe that the full prompt is cleared instead of switching to Normal mode.
To reproduce the turn-cancellation behavior, enter Insert mode while the agent is working and press Ctrl+C.
Actual behavior
Ctrl+Cclears the entire draft prompt rather than moving from Insert mode to Normal mode.- When a turn is running,
Ctrl+Ccan also cancel the turn instead of first leaving Insert mode.
Expected behavior
While in Vim Insert mode, Ctrl+C should switch to Normal mode and preserve the full draft, whether the agent is idle or running. This mode transition should not cancel an active turn. Once in Normal mode, Ctrl+C can retain its existing behavior.
Why this matters
Using Ctrl+C to leave Insert mode is established Vim muscle memory. In Codex, that habit can erase a prompt being edited and interrupt the agent when composing a follow-up message.
Environment
- Currently installed CLI version:
codex-cli 0.153.4 - Platform: macOS
Related issues
- #12582 requests requiring Escape twice to interrupt, addressing a related accidental-interruption problem.
- #29883 requests a configurable
jjsequence for leaving Vim Insert mode.
This report specifically requests support for Ctrl+C to leave Vim Insert mode, with that transition taking priority over clearing the prompt or cancelling the turn.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the interactive Codex CLI's Vim-mode composer and reproduce Ctrl+C in Insert mode while idle and while an agent turn is running. Done means Ctrl+C preserves the draft and enters Normal mode in both cases without cancelling the turn, while its existing Normal-mode behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100