Skip to content

Anchor prompt to bottom of viewport when scrollback exists #16134

@cweill

Description

@cweill

Problem

When running codex in a terminal pane with scrollback history above the current prompt, the prompt floats mid-screen with blank space below it. This wastes viewport height, especially in multiplexer setups (tmux, amux) where codex runs in small panes (e.g., 30x22).

Example: a 22-row pane shows ~5 rows of prompt/status bar, then 17 blank rows below. The scrollback history is above but the prompt doesn't anchor to the bottom.

Expected behavior

The prompt should anchor to the bottom of the viewport when scrollback exists — scrollback fills upward, new content pushes from the bottom. This is how shells and most TUI chat interfaces work.

Repro

  1. Start codex in a small terminal pane (~30 columns, ~20 rows)
  2. Run a task so there's scrollback history
  3. After the task completes, observe the prompt position — it sits mid-screen with blank space below

Context

This is particularly visible when running many codex instances in parallel in a terminal multiplexer grid (15+ panes). Every pane is mostly blank space at the idle prompt.

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions