Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The SU (scroll up) sequence should pan the viewport down #11078

Open
j4james opened this issue Aug 29, 2021 · 3 comments
Open

The SU (scroll up) sequence should pan the viewport down #11078

j4james opened this issue Aug 29, 2021 · 3 comments
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase
Milestone

Comments

@j4james
Copy link
Collaborator

j4james commented Aug 29, 2021

Windows Terminal version (or Windows build number)

10.0.18363.1500, 1.10.1933.0

Other Software

No response

Steps to reproduce

  1. Open a bash shell in conhost or Windows Terminal.
  2. Set the window height to something smallish like 24 rows.
  3. Execute the following commands: for i in {1..100}; do echo $i; done; tput indn 10
  4. Scroll back to view the lines that have been moved off screen.

Expected Behavior

There should be no gap in the sequence of numbers.

Actual Behavior

There are numbers missing from the sequence at the point where they've scrolled off screen.

image

The problem here is that there are two ways in which the SU escape sequence is typically implemented in Linux terminals. Most terminals, including XTerm, will pan the viewport down, as if you'd executed a linefeed at the bottom of the window. Lines at the top of the window will be moved into the scrollback buffer, and nothing is lost.

On VTE-based terminals, and Konsole, the SU escape sequence will just scroll the buffer contents up, constrained within the visible area. This is equivalent of deleting lines from the top of the window, so anything that scrolls off screen is lost. And that's the behavior that we're currently matching.

From a DEC VT-compatibility point of view, I don't think either interpretation is correct, so that's not a deciding factor. But the reason I think we should be matching XTerm, is because the indn terminfo capability is defined as SU, and the ind capability is defined as a linefeed control, so I think there is an expectation that indn should produce the equivalent of multiple linefeeds.

If we aren't going to do that, then we probably shouldn't be using xterm-256color for our TERM value.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 29, 2021
@zadjii-msft
Copy link
Member

This looks vaguely like #3673, but I'll mark it up for investigation regardless. I think we used to do this at some point, and either decided to stop, or maybe we implemented margins better and that regressed this, can't be sure.

@zadjii-msft zadjii-msft added Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase labels Mar 8, 2022
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Mar 8, 2022
@zadjii-msft zadjii-msft added this to the 22H2 milestone Mar 8, 2022
@j4james
Copy link
Collaborator Author

j4james commented Mar 8, 2022

Yeah, I think it would have the same effect as #3673, although it's a totally different cause. This affects conhost, while #3673 is a limitation of conpty, which doesn't understand margins (and that should eventually be fixed by pass-through mode).

I also suspect this one is less likely to be encountered, considering VTE and Konsole work the same way as us. It's not entirely hypothetical though (see dankamongmen/notcurses#2114).

@carlos-zamora carlos-zamora modified the milestones: 22H2, Backlog Mar 16, 2023
@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Mar 16, 2023
@zadjii-msft
Copy link
Member

Another theoretical effect:

Windows Terminal version

1.16.10261.0

Steps to reproduce

  1. Run other program, generate many lines of content(Like benchmark)
  2. Scroll down or up the wheel(The disappearing row must be moved to an invisible area before it can be seen again)
  3. Some lines will disappear

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-VT Virtual Terminal sequence support Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

3 participants