microsoft / microsoft/terminal

WT scrolls to top if in scrollback & scrollback cleared `ESC[3J`

Open
#20,370 5 comments 11 reactions 0 assignees View on GitHub
Area-AtlasEngine Area-Rendering Area-VT Impact-Visual Issue-Bug Product-Conhost Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.24.11321.0

### Windows build number

10.0.26310.0

### Other Software

_No response_

### Steps to reproduce

1. Have some scrollback
2. Scroll a bit up to the scrollback area
3. Have app emit `ESC[3J`

E.g. run this node script + scroll a bit up (it'll immediately jump to the top after a bit). It doesn't in other terminals, s.a. alacritty.

[wt-scroll-vs-inplace.js](https://github.com/user-attachments/files/29436219/wt-scroll-vs-inplace.js)

1. `node wt-scroll-vs-inplace.js`
2. scroll a bit up
3.

It's for sure the `ESC[3J`, you can verify that via other options of the script.

### Expected Behavior

View jumps to the bottom (or less possibly stays where it was).
(as happens in allacritty, and many many other terminals)

### Actual Behavior

View jumps to the absolute top.

Contributor guide

Open the contributing guide

Research direction

Start by running the attached wt-scroll-vs-inplace.js script with Windows Terminal 1.24.11321.0, following the listed scrollback and ESC[3J steps. Trace the viewport handling for scrollback clearing and verify that the view reaches the bottom or remains in place instead of jumping to the absolute top.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.