-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Comments
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 |
I was seeing a different behavior in wsltty which leads me to think that WT is weird. Then I confirmed that iTerm2 is also doing the same thing. So…guess I’m misunderstanding this. Still, this seems to be the root cause of the flickering, I think somewhere the refresh rate is limited by something.
获取 Outlook for iOS<https://aka.ms/o0ukef>
|
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. |
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). |
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. |
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. |
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). |
I'm comfortable with the current scrolling behavior, but I'll keep this in our back pocket in case we want to change it.
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. |
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: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.
The text was updated successfully, but these errors were encountered: