TUI: Add support for Ctrl-P/N navigation in remaining surfaces

Resolved 💬 4 comments Opened Mar 9, 2026 by aofei Closed Apr 11, 2026

What version of Codex CLI is running?

codex-cli 0.112.0

What subscription do you have?

ChatGPT Pro

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Ghostty

What issue are you seeing?

In several selectable TUI surfaces, Ctrl-P and Ctrl-N do not move the highlighted item even though that navigation works in other parts of the CLI.

This is inconsistent with the broader Ctrl-P/N navigation convention introduced in #1994, and with the more recent fixes in #7530 and #7629.

Examples of affected surfaces:

  • the session picker opened by /resume
  • the session picker opened by codex resume
  • the working-directory prompt shown after /resume or /fork
  • the onboarding auth mode picker
  • the trust-directory prompt
  • the model migration prompt
  • the update prompt
  • the app-link action picker

What steps can reproduce the bug?

  1. Start Codex CLI.
  2. Open one of the selectable TUI surfaces listed above. For example, use /resume in the TUI.
  3. Press Ctrl-N or Ctrl-P.
  4. Observe that the highlighted selection does not move.

On terminals that send C0 control bytes without the CONTROL modifier, the same issue also shows up for ^N and ^P.

What is the expected behavior?

Ctrl-P and Ctrl-N should move the highlighted selection the same way as Up and Down, matching the behavior already supported in other TUI surfaces.

The C0 fallback bytes for those chords should be treated the same way, so terminal-specific input encoding differences do not break navigation.

Additional information

From a local audit, these surfaces appear to use custom key handlers instead of the shared list-selection logic updated in #7629, so they did not inherit that fix.

#7530 already handled the same terminal-fallback problem for textarea.

#1994 established Ctrl-P / Ctrl-N as a broader CLI navigation convention, so this looks like a remaining gap rather than a new behavior request.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗