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

Discuss: Should ED 2 (EraseType::All) push text on the screen into the scrollback? #7894

Open
skyline75489 opened this issue Oct 12, 2020 · 8 comments
Labels
Area-VT Virtual Terminal sequence support Issue-Question For questions or discussion Product-Conhost For issues in the Console codebase
Milestone

Comments

@skyline75489
Copy link
Collaborator

skyline75489 commented Oct 12, 2020

Description of the new feature/enhancement

So I was investigating the "docker stats" flicking issue(#1680) and found something weird. The sequences generated by docker stats first erase-all then print the stats. The way conhost and WT implements this (ITerminalApi::EraseInDisplay), is to push everything on the screen into the scrollback and print new things:

image

Proposed technical implementation details (optional)

I don't know why this is like this but I'm sure there's a reason, and I feel that changing this might fix the flickering.

@skyline75489 skyline75489 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Oct 12, 2020
@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 Oct 12, 2020
@skyline75489 skyline75489 added the Area-VT Virtual Terminal sequence support label Oct 12, 2020
@zadjii-msft
Copy link
Member

I'm almost certain that's how it's supposed to work. IIRC, conhost did this wrong for our first few releases with VT support.

@j4james can put me on blast if I'm wrong about this

@skyline75489
Copy link
Collaborator Author

skyline75489 commented Oct 12, 2020 via email

@j4james
Copy link
Collaborator

j4james commented Oct 12, 2020

I'm honestly not sure where the idea of scrolling to clear the screen came from. The DEC STD 070 manual doesn't say anything about ED 2 scrolling, so I don't think think it's something the original hardware terminals did.

Some terminal emulators do scroll, and some don't. VTE is one popular example that does, while XTerm doesn't (at least by default - it might have an option somewhere for that). If we really want to be compatible with XTerm, we may want to consider disabling this by default, and maybe have an option to reenable it for those users that prefer the current behaviour.

As for the docker stats performance issue, is that a problem in conhost too? Because it occurred to me that it might just be relying on the alt buffer, which WT doesn't yet support (see #381). Clearing the screen while in the alt buffer shouldn't normally scroll anything because there is no scrollback, but that's not the case in WT.

@j4james
Copy link
Collaborator

j4james commented Oct 12, 2020

I just remembered there was some previous discussion on this subject in issue #2832 (comment).

Also I think VTE was (and possibly still is) considering matching the XTerm behaviour (see here).

@jack775544
Copy link

As for the docker stats performance issue, is that a problem in conhost too?

I checked this on both both conhost shipped in windows 2004 and OpenConsole shipped with terminal 1.4 and it still flashes the same as on WT.

@skyline75489
Copy link
Collaborator Author

skyline75489 commented Oct 13, 2020

I can also confirm the flickering in both conhost and WT. And no, it does not use alt buffer to my knowledge. It's just pure ED2 and print.

Because of the current clearing behavior, WT also has the same "Ctrl-L adding empty line" issue, as described in VTE 506438 and Konsole 384218. Also @egmontkob has filed this https://gitlab.gnome.org/GNOME/vte/-/issues/84 .

Interestingly, I can not reproduce the "Ctrl-L" bug in Ubuntu Terminal or kitty. I don't have KDE at hand so I can't check Konsole. And it is indeed an annoying bug if someone is using "Ctrl-L" a lot.

@j4james
Copy link
Collaborator

j4james commented Oct 13, 2020

For the record, I'd be happy for us to make ED2 just clear the screen normally (i.e. matching the XTerm behaviour), unless there's evidence that the scrolling thing is an actual DEC standard (and I haven't seen anything suggesting that).

@DHowett
Copy link
Member

DHowett commented Oct 23, 2020

I'm comfortable with the current scrolling behavior, but I'll keep this in our back pocket in case we want to change it.

If we really want to be compatible with XTerm ...

I'm honestly fifty-fifty on whether this is a compatibility break. There's a line between application-visible compatibility (sequences change the addressable buffer in a known way, colors are treated just so, etc.) and user-visible compatibility (scrollback acts like this, the mouse does this, etc.), and I prefer our xterm compatibility to be to be on the application side.

Xterm doesn't do a lot of the things we do, but if applications can't detect that chicanery I'm less worried about it. If we wanted to be xterm's user interface, we could cut out a whole bunch of our work!

I'm going to keep this one open as a discussion. I see the argument that it's unfortunate from a security perspective, but I know that we'd get a lot of flak for changing it.

@DHowett DHowett added Issue-Question For questions or discussion and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Oct 23, 2020
@DHowett DHowett changed the title EraseType::All implemented as pushing text on the screen into the scrollback DIscuss: EraseType::All implemented as pushing text on the screen into the scrollback Oct 23, 2020
@DHowett DHowett changed the title DIscuss: EraseType::All implemented as pushing text on the screen into the scrollback Discuss: EraseType::All implemented as pushing text on the screen into the scrollback Oct 23, 2020
@DHowett DHowett changed the title Discuss: EraseType::All implemented as pushing text on the screen into the scrollback Discuss: Should ED 2 (EraseType::All) push text on the screen into the scrollback? Oct 23, 2020
@zadjii-msft zadjii-msft added the Product-Conhost For issues in the Console codebase label Oct 23, 2020
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Oct 23, 2020
@zadjii-msft zadjii-msft added this to the Backlog milestone Jan 20, 2022
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 Issue-Question For questions or discussion Product-Conhost For issues in the Console codebase
Projects
None yet
Development

No branches or pull requests

5 participants