Skip to content

Scroll-back broken and screen flickers during multi-agent runs in non-VP mode #5798

Description

@chiga0

Summary

In non-VP mode (default), when conversation output plus the footer exceeds the terminal height while background agents are running, the view cannot be scrolled up — any scroll-up immediately snaps back to the bottom and the screen flickers. The issue resolves on its own once the agent run finishes.

Steps to Reproduce

  1. Use default settings (non-VP mode, ui.useTerminalBuffer unset)
  2. Run a flow that launches several background agents (e.g., a parallel review with multiple subagents)
  3. Wait for conversation/tool output to fill the terminal height
  4. Try to scroll up while agents are still running

Expected Behavior

The view should scroll up normally, showing earlier output.

Actual Behavior

  • Scroll-up immediately snaps back to the bottom
  • Screen flickers during each repaint cycle (~1s intervals)
  • Issue resolves once all agents finish

Root Cause

controlsHeight (footer height) is measured in a useLayoutEffect whose dependencies don't include the agent roster state. When LiveAgentPanel grows (agents launching/changing status), the measurement effect doesn't re-run, leaving controlsHeight stale (too small). This causes the content area to overflow the terminal viewport, and the per-second elapsed-time ticks force repaints that snap the view to the bottom.

Environment

  • OS: macOS
  • Qwen Code version: latest main
  • ui.useTerminalBuffer: not set (default false)

Metadata

Metadata

Assignees

Labels

category/uiUser interface and displaypriority/P2Medium - Moderately impactful, noticeable problemscope/componentsUI components and widgetsscope/renderingDisplay and rendering logicstatus/needs-triageIssue needs to be triaged and labeledtype/bugSomething isn't working as expectedwelcome-pr

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