Skip to content

TUI: scroll renders stray ANSI-like characters on screen intermittently #23

Description

@vtemian

Summary

Scrolling a pane (via mouse wheel or keyboard) intermittently leaves stray characters on screen that look like ANSI escape sequence fragments.

Reproduction

Steps observed by reporter:

  1. Open a conversation pane with enough content to scroll.
  2. Scroll down/up repeatedly.
  3. Occasionally, fragments like ;26M5;975;97;26M5;97;26M4;97;26M5;97;26M render on screen.

Expected behavior

Scrolling repaints cleanly with no artifacts.

Actual behavior

Intermittent escape-sequence-like characters appear in the pane.

Context

  • The characters resemble SGR mouse-tracking fragments (CSI < btn;x;y M/m) or truncated SGR/cursor-positioning output.
  • Relevant subsystems:
    • src/Screen.zig — dirty-rectangle render, clearRect, force_full_clear
    • src/Compositor.zigdrawDirtyLeaves, drawBufferIntoRect, scroll offset handling
    • src/Viewport.zigscroll_dirty / isDirty logic
    • src/Terminal.zig — synchronized output enable (CSI ?2026h/l), mouse tracking (?1006)
  • Missing details:
    • Terminal emulator name and version.
    • Whether it reproduces with keyboard scroll (PageUp/PageDown/Ctrl-U/D) or only mouse wheel.
    • Whether this is a recent regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions