Skip to content

fix(tui): preserve modified enter in plan questions#23536

Merged
fcoury-oai merged 2 commits into
mainfrom
fcoury/fix-plan-question-shift-enter
May 19, 2026
Merged

fix(tui): preserve modified enter in plan questions#23536
fcoury-oai merged 2 commits into
mainfrom
fcoury/fix-plan-question-shift-enter

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

Why

Plan mode questionnaires reuse the shared composer for free-form answers, but the surrounding request_user_input overlay still treated every KeyCode::Enter as “advance to the next question.” That made Shift+Enter insert a newline in the composer and then immediately advance the questionnaire anyway.

Fixes #23448.

What Changed

  • pass the live RuntimeKeymap into RequestUserInputOverlay so its embedded composer honors existing /keymap composer/editor remaps
  • advance free-form questions only on the configured composer submit binding, instead of any Enter-shaped key event
  • add regressions for Shift+Enter newline behavior and configured composer submit bindings inside the questionnaire UI

How to Test

  1. Start Codex in Plan mode and trigger a request_user_input questionnaire with a free-form answer field.
  2. Focus the free-form field, type a line, then press Shift+Enter.
  3. Confirm the answer gains a newline and the questionnaire stays on the same question.
  4. Press the configured submit binding, or plain Enter with the default keymap, and confirm the questionnaire advances as before.

Targeted tests:

  • cargo test -p codex-tui bottom_pane::request_user_input::tests::freeform_ -- --nocapture

Notes

  • cargo test -p codex-tui still reaches an unrelated existing stack overflow in app::tests::discard_side_thread_removes_agent_navigation_entry on this checkout.
  • just argument-comment-lint is locally blocked by Bazel analysis failing in external compiler-rt before the lint runs.

@fcoury-oai fcoury-oai marked this pull request as ready for review May 19, 2026 19:35
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d35f2dd51

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/tui/src/bottom_pane/request_user_input/mod.rs Outdated
Comment thread codex-rs/tui/src/bottom_pane/request_user_input/mod.rs Outdated
Copy link
Copy Markdown
Contributor

@canvrno-oai canvrno-oai left a comment

Choose a reason for hiding this comment

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

Tested with /plan mode and triggering a free form (Tab/Add notes) input. Shift+Enter added a newline as expected without attempting to submit the partial entry. Compared against the current release, where the issue was easily duplicated following the same steps.

@fcoury-oai fcoury-oai merged commit 40be417 into main May 19, 2026
31 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/fix-plan-question-shift-enter branch May 19, 2026 21:01
@github-actions github-actions Bot locked and limited conversation to collaborators May 19, 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.

Shift+Enter in Plan mode questions UI inserts newline but also advances to the next question

2 participants