Skip to content

fix(tui): TUI double rendering on lines matching terminal width #6562

Description

@2bitbit

What happened?

When rendering/padding a line that exactly matches the terminal width, the terminal auto-wraps the cursor. A subsequent \r\n causes an unintended double-wrap, desynchronizing the physical cursor from TUI's hardwareCursorRow tracking. This causes subsequent differential rendering updates (like spinner frames or streamed text) to be drawn on incorrect rows, leading to repeated/duplicate rendering.

Steps to reproduce

  1. Run pi -ne in a terminal.
  2. Ask the agent to output a long paragraph where a wrapped line matches the terminal width exactly.
  3. Observe duplicated loader/spinner lines (Working...) and duplicate text lines.

Expected behavior

The terminal cursor should stay synchronized with TUI, and rendering should be clean without duplicate lines or indicator duplicates.

Version

0.80.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    no-actionThis issue has been rejected after triage

    Type

    No type

    Fields

    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