Skip to content

Terminal display corruption: rendered output overlaps/duplicates mid-session #38

@AThraen

Description

@AThraen

Symptom

The terminal display occasionally gets visibly corrupted — chunks of previously-rendered output overlap with current output. The bottom toolbar/status-bar area can appear duplicated, and lines from different parts of the buffer collide on the same row. Screenshot shows it happening inside a Claude session (ink TUI in auto-mode, mid-stream).

(Screenshot will be attached by the reporter — local copy at image-cache/18bf3a04-cb45-439b-ab12-be721bbe0ad9/1.png.)

Likely causes (in order of likelihood)

  1. Resize during in-flight TUI redraw. Ink redraws by ANSI cursor positioning, not full-screen clear. If the WebView2 reports a new size while ink is mid-frame, the next frame writes to addresses that no longer match the visual grid → overlap.
  2. PTY size drift. xterm.js's reported cols/rows and the PTY's ResizePseudoConsole value briefly disagree (e.g. resize message races with output). The shell renders at one size while xterm renders at another.
  3. xterm.js alternate-screen-buffer transition. Switching in/out of the alt buffer (\e[?1049h/l) mid-stream can leave stale rows visible if the transition lands between two write chunks.
  4. Partial-recovery from a stall. May correlate with the intermittent typing-freeze report — if the PTY read loop or WPF dispatcher stalls and then catches up, a backlog of small output chunks could replay out of phase with the app's cursor model.

Repro signals to collect

Not reliably reproducible. When it happens, useful to note:

  • Whether the WPF window or pane was resized in the last few seconds
  • Whether the Claude/TUI session was streaming a long response when corruption appeared
  • Whether enabling Settings > Diagnostics > Trace terminal input/output (PR feat: terminal trace setting + shutdown/restore stability fixes #36) preceding the event captures unusual [DEBUG-tt] gaps in crash.log

Workarounds

  • Resize the pane — typically triggers an app-side redraw and clears the corruption
  • Scroll to the top of the buffer and back
  • Worst case: close and reopen the session

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions