Skip to content

Terminal resize during streaming leaves fragmented content at wrong widths in scrollback #4891

@tanzhenxin

Description

@tanzhenxin

Summary

Resizing the terminal window during generation produces fragmented output — scrolling back reveals content rendered at different widths, with tool call box borders (────) terminating at inconsistent columns. The user sees alternating "segments" of narrow and wide content.

Steps to reproduce

  1. Launch qwen --approval-mode yolo in Terminal.app or iTerm2
  2. Send a prompt that triggers tool calls (e.g. "Read test.txt, create utils.js, config.json, README.md, then list and verify all files")
  3. While tool calls are executing, drag the terminal window edge to resize it 3-5 times (narrow → wide → narrow)
  4. After generation completes, scroll to the top of the output

Expected behavior

All content should be at the current terminal width, regardless of how many resizes happened during generation.

Actual behavior

Scrollback shows content rendered at the width the terminal happened to be during each resize event. Tool call boxes are the most visible symptom — their ──────── border lines terminate at different columns, creating distinct "segments" at mismatched widths.

Example (window is 140 cols, but scrollback shows ~60-col content):

┌────────────────────────────────────────────────────────┐
│ >_ Qwen Code (v0.18.0-preview.0)                      │
│ API Key | claude-opus-4-6 (/model to change)           │
└────────────────────────────────────────────────────────┘

> Read test.txt and app.js, then create three new
  files...

┌────────────────────────────────────────────────────────┐
│ ✓ ReadFile test.txt                                    │
│ ✓ ReadFile app.js                                      │
└────────────────────────────────────────────────────────┘

While the bottom of the output has full-width boxes spanning all 140 columns.

Additional info

  • We were unable to reproduce this using tmux pane resize — it requires a real terminal window resize (drag the window edge).
  • macOS (Terminal.app, iTerm2)
  • Reproduced on v0.18.0-preview.0, reported on v0.17.1
  • Default rendering path (useTerminalBuffer=false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    category/uiUser interface and displaypriority/P2Medium - Moderately impactful, noticeable problemscope/macosmacOS specific issuesscope/renderingDisplay and rendering logictype/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