Skip to content

TUI shortcut to jump between user prompts in the transcript #21732

Open

Description

@filipores

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:

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.

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    on May 8, 2026
  2. github-actions commented on May 8, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. bberenberg commented on May 13, 2026

    @bberenberg

    @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.

  4. etraut-openai commented on May 13, 2026

    @etraut-openai
    Contributor

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

  5. PaulRBerg commented on Jul 17, 2026

    @PaulRBerg

    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.

  6. bhavyashah commented on Jul 21, 2026

    @bhavyashah

    @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.

  7. Coiggahou2002 commented on Aug 10, 2026

    @Coiggahou2002

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions