Skip to content

Conversation

@aofei
Copy link
Contributor

@aofei aofei commented Dec 3, 2025

  • Treat Ctrl-P/N (and their C0 fallbacks) the same as Up/Down so cursor movement matches popup/history behavior and control bytes never land in the buffer

Fixes #7529

- Treat Ctrl-P/N (and their C0 fallbacks) the same as Up/Down so cursor
  movement matches popup/history behavior and control bytes never land
  in the buffer

Fixes openai#7529

Signed-off-by: Aofei Sheng <[email protected]>
Copilot AI review requested due to automatic review settings December 3, 2025 15:52
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@aofei
Copy link
Contributor Author

aofei commented Dec 3, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Dec 3, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Emacs-style Ctrl-P/N keyboard shortcuts for vertical cursor navigation in the textarea component, matching the behavior already provided for Ctrl-B/F horizontal navigation. The change ensures these control characters are properly mapped to cursor movement rather than being inserted as literal control bytes into the text buffer.

  • Maps Ctrl-P to up arrow and Ctrl-N to down arrow for consistent Emacs-style navigation
  • Handles both the standard Ctrl+key combinations and C0 control character fallbacks for terminals that don't report the CONTROL modifier

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@etraut-openai
Copy link
Collaborator

Thanks for the contribution. The change looks good to me.

One note is that codex is cross-platform, so we need to make sure that key combinations like this work on Windows, which tends to use ctrl key combinations differently than MacOS and Linux.

@etraut-openai etraut-openai merged commit de08c73 into openai:main Dec 3, 2025
51 of 54 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
@aofei aofei deleted the textarea branch December 4, 2025 00:02
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.

Handle Ctrl-P and Ctrl-N as Up/Down aliases in the TUI input

3 participants