Skip to content

feat(tui): make turn interruption keybind configurable#24766

Merged
fcoury-oai merged 1 commit into
mainfrom
fcoury/turn-stop-keybind
May 27, 2026
Merged

feat(tui): make turn interruption keybind configurable#24766
fcoury-oai merged 1 commit into
mainfrom
fcoury/turn-stop-keybind

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

Why

Interrupting an active turn is currently fixed to Esc, which is easy to hit accidentally and cannot be customized through /keymap. This gives users a less accidental binding while preserving the existing default.

What Changed

  • Adds tui.keymap.chat.interrupt_turn to /keymap, defaulting to esc and supporting remapping or unbinding.
  • Uses the configured interrupt binding for running-turn status, queued steer interruption, and request_user_input, including the visible hints.
  • Preserves local Esc behavior for popups, Vim insert mode, and /agent editing while validating conflicts with fixed/backtrack and request-input navigation bindings.
  • Adds behavior and snapshot coverage for remapped interruption paths.

How to Test

  1. Run Codex and open /keymap, then set Interrupt Turn to f12.
  2. Start a turn and confirm Esc no longer interrupts it while f12 does; the running hint should display f12 to interrupt.
  3. Queue a steer while a turn is running and confirm the preview displays f12; pressing it should interrupt and submit the steer immediately.
  4. Trigger a request_user_input prompt and confirm its footer uses f12; with notes open, Esc should still clear notes while f12 interrupts the turn.
  5. Clear the Interrupt Turn binding and confirm the key-specific interrupt hint is removed while Ctrl+C remains available.

Targeted validation:

  • just write-config-schema
  • just fix -p codex-config
  • just fix -p codex-tui
  • just fmt
  • just argument-comment-lint-from-source -p codex-config -p codex-tui
  • just test -p codex-config
  • cargo insta pending-snapshots --manifest-path tui/Cargo.toml
  • just test -p codex-tui keymap_setup::tests
  • just test -p codex-tui (fails in two pre-existing guardian feature-flag tests unrelated to this diff; the intentional picker snapshot updates were reviewed and accepted)

@fcoury-oai fcoury-oai requested a review from a team as a code owner May 27, 2026 15:53
@fcoury-oai fcoury-oai changed the title feat(tui): make turn interruption configurable feat(tui): make turn interruption keybind configurable May 27, 2026
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good

I built and validated manually

@fcoury-oai fcoury-oai force-pushed the fcoury/turn-stop-keybind branch from 91c2c58 to 6f40bbe Compare May 27, 2026 18:25
@fcoury-oai fcoury-oai enabled auto-merge (squash) May 27, 2026 18:29
@fcoury-oai fcoury-oai merged commit 2d1ad37 into main May 27, 2026
42 of 47 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/turn-stop-keybind branch May 27, 2026 18:59
@github-actions github-actions Bot locked and limited conversation to collaborators May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants