Cursor-agent CLI: mouse scroll in Ghostty snaps back to bottom (Codex does not)

Where does the bug appear (feature/product)?

Cursor CLI (cursor-agent)

Describe the Bug

In Ghostty, while using cursor-agent, scrolling up with the mouse / trackpad to read earlier output immediately jumps the viewport back to the bottom.

This is not a Ghostty config issue: Codex CLI in the same Ghostty terminal, same profile, does not snap back. Scrolling stays where I left it.

It looks like cursor-agent’s TUI keeps auto-following / redrawing the latest line (alternate screen + mouse tracking + frequent re-renders), so any manual scroll is overwritten on the next frame.

Related threads (same TUI scroll problem, different symptoms):

Steps to Reproduce

  1. Open Ghostty on macOS.
  2. Run cursor-agent and produce more than one screen of output (streaming reply or tool output).
  3. Scroll up with the mouse / trackpad to read earlier content.
  4. The view snaps back to the bottom almost immediately.
  5. Repeat in the same Ghostty profile with Codex CLI — the scroll position stays put.

Expected Behavior

Scrolling up should pause auto-follow until I return to the bottom, same as Codex.

Operating System

macOS 26.2 (Build 25C56)

Version Information

  • cursor-agent: 2026.08.11-e8db854
  • Ghostty: 1.3.1 (stable)
  • Ghostty mouse-reporting = true (Cmd+Shift+M toggles it). Codex still scrolls normally with this config.

Does this stop you from using Cursor

No — Cursor works, but reviewing long CLI sessions is painful.

Thanks for the post! You’re right that this isn’t your Ghostty config, and it’s not specific to Ghostty either. The mechanism is a little different from your guess, in a way that matters for workarounds: the CLI doesn’t use the alternate screen or request mouse tracking on the main chat view, so mouse-reporting isn’t involved. What happens is that the live region at the bottom (streaming text, status, input box) gets rewritten in place many times a second, and once that region grows taller than the window the redraw falls back to a full clear that wipes scrollback. There’s nowhere for your scroll position to survive, so the viewport pins to the bottom.

Two things that help today: scrolling works normally once the agent is idle, and a taller terminal window makes the full-clear path fire much less often during a turn.

This is an issue we’re tracking, and your Ghostty datapoint is a useful one to add. I’ll post here when I have an update.