openai / openai/codex

Vim mode: Ctrl+C clears the prompt instead of exiting Insert mode

Open
#43,139 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug CLI TUI
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
  1. Enable Vim mode in the interactive Codex CLI.
  2. Enter Insert mode in the composer and type a prompt without submitting it.
  3. Press Ctrl+C, expecting to return to Normal mode.
  4. 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+C clears the entire draft prompt rather than moving from Insert mode to Normal mode.
  • When a turn is running, Ctrl+C can 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 jj sequence 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.