TUI shortcut to jump between user prompts in the transcript

Open 💬 6 comments Opened May 8, 2026 by filipores
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

Add keyboard shortcuts in the Codex CLI TUI to jump between user prompt blocks in the current transcript, so users can quickly revisit the assistant output that followed a previous prompt.

For example:

  • Jump to previous user prompt: Alt+Up or another available shortcut
  • Jump to next user prompt: Alt+Down or another available shortcut
  • Keep the selected prompt and the assistant output immediately below it visible
  • Ideally support repeated jumps through the whole visible/current session transcript

Why is this useful?

In longer Codex CLI sessions, it is common to ask several prompts and later want to review the output underneath one of the recent prompts. Today, this usually requires manual terminal scrollback or text search. That works, but it is slow and imprecise when the transcript is long or when prompts have similar wording.

Prompt-to-prompt navigation would make it much easier to inspect earlier answers, compare outputs from recent prompts, and recover context without leaving the keyboard.

Related but different issues

This overlaps with existing navigation/history requests, but I think it is a distinct workflow:

  • #2622 asks for interactive reverse search through prompt history, mainly to find and reuse previous prompts.
  • #1064 asked for broader in-TUI scroll navigation such as PageUp/PageDown and Home/End.
  • #14277 discusses scrollback preservation with --no-alt-screen in xterm.js-based terminals.

This request is specifically about navigating between user prompt anchors inside the current Codex CLI transcript, with the goal of quickly reaching the assistant output under each prompt.

Suggested UX

One possible behavior:

  1. User presses the shortcut for previous prompt.
  2. The TUI scroll position moves to the previous user prompt block.
  3. The prompt is placed near the top of the viewport, leaving the following assistant output visible below it.
  4. Repeating the shortcut moves to older prompts; the opposite shortcut moves forward again.

Are you interested in implementing this feature?

No, but I would be happy to test and provide feedback.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 3 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #20651

Powered by Codex Action

bberenberg · 3 months ago

@etraut-openai would the team be open to accepting an external contribution for this? I regularly have 30+ minute hands off sessions and figuring out the scroll back point has been frustrating.

etraut-openai contributor · 3 months ago

@bberenberg, we generally prioritize enhancement requests based on community input (upvotes). We don't accept PRs from external sources for reasons explained here.

PaulRBerg · 1 month ago

This would make a material difference for me. The current Ctrl+B / Shift+Space page-up behavior in the transcript overlay no longer scales well to modern Codex sessions. As the models have become more capable, and especially with higher-effort modes such as Ultra, individual turns can produce much longer responses and tool traces. Reaching the response associated with my previous prompt can require paging through many screens.

Page-based movement isn't a useful substitute for prompt-anchor navigation in that workflow. A previous/next user-prompt action would provide a stable semantic navigation point regardless of how much output each turn contains, and would make reviewing long-running sessions significantly faster.

bhavyashah · 1 month ago

@etraut-openai As a blind, keyboard-only screen reader user, this feature would be very helpful. I have no way to eyeball the end of a response and start of a prompt, and the existing units of navigation don't allow me to efficiently sift through lengthy turns.

Coiggahou2002 · 17 days ago

I inspected the current main implementation (at 680934adc4). Most of the required machinery now exists, although it is currently coupled to the edit/backtrack flow.

Relevant existing pieces:

  • app_backtrack.rs already indexes UserHistoryCell entries and steps backward/forward through user prompts.
  • TranscriptOverlay::set_highlight_cell can identify a selected cell.
  • PagerView::scroll_chunk_into_view already performs width-aware scrolling after render, when wrapped heights are known.
  • The configurable keymap already has a dedicated pager context.

I would propose a separate, non-destructive navigation state rather than reusing BacktrackState, because prompt review must not imply editing or forking:

  1. add pager actions for previous/next user prompt (the exact default binding can follow maintainer preference);
  2. keep the current prompt-cell index in TranscriptOverlay;
  3. add a “place chunk at viewport top” request, rather than merely ensuring the cell is somewhere on screen, so the following assistant output remains visible;
  4. reuse the existing user-cell indexing while keeping Esc/Left/Right backtrack semantics unchanged;
  5. preserve the selection across pagination prepends and cell consolidation.

Tests would cover repeated backward/forward traversal, boundaries, wrapped prompts, pagination index remapping, and a transcript snapshot showing the prompt at the top with following output visible.

I would keep mouse hover and native terminal scrollback out of this first change: Codex currently discards mouse events, while the Ctrl+T overlay already owns keyboard navigation deterministically.

@fcoury, if this direction matches the intended UX, would you be open to inviting an external PR?