Skip to content

Windows Terminal scrolls to the top when pi-tui sends ESC[3J #6502

Description

@WodenJay

What happened?

While using pi in Windows Terminal, the terminal repeatedly scrolls to the top during normal TUI redraws.

The problem is caused by this sequence in pi-tui/dist/tui.js:

buffer += "\x1b[2J\x1b[H\x1b[3J";

\x1b[3J clears the terminal scrollback buffer. Removing only that sequence completely stops the unwanted scrolling:

buffer += "\x1b[2J\x1b[H";

The same extensions remained enabled before and after the modification.

This appears related to #4506, which was closed during the project refactor, but the problem is still present on Windows Terminal in pi 0.80.6.

Steps to reproduce

  1. Run pi in Windows Terminal.
  2. Use it until a full TUI redraw occurs. (I ask pi to use find-skills skill to find some skills)
  3. Observe that the terminal viewport unexpectedly scrolls to the top.
  4. Remove \x1b[3J from the fullRender clear sequence.
  5. Restart pi and observe that the scrolling no longer occurs.

Expected behavior

A full redraw should refresh the visible screen without clearing the terminal scrollback or changing the user's viewport position.

Version

0.80.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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