-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Running clear in terminal removes viewport content from buffer instead of hiding it #106
Comments
Here is the spec for the signal that's received (2):
http://www.vt100.net/docs/vt100-ug/chapter3.html The right thing might be to clear absolutely everything like |
So should we move forward with closing this issue and leave the cleaning behavior as is? |
@parisk well it looks like a bug to me, maybe just doing what xterm does would be better considering that is what this is trying to emulate? |
Well, did some tests. I think that your proposal of "shifting rows up" instead of removing them from buffer provides the best UX, even if it is not 100% xterm compliant. |
I just ran into this with: microsoft/vscode#19934 I would like to paste my use-case here for consideration: My use-case (also how powershell works):
Therefor I disagree with just shifting rows up. |
Here's a roundup of behavior in various terminal emulators when they receive an Erase All ED signal (
Based on some references I found, it seems ambiguous what exactly this escape sequence is meant to be since this one says "Erase All", and this one says "Erase Screen". The actual xterm behavior however would seem to indicate that it means clear everything. To me |
Based on the name of the signal, I think as well that xterm's implementation is the most reasonable. But, I think also that xterm.js' implementation is the one that you will regret less, if it's done accidentally 😅 , so for me (personally) it's more desirable. What is the use case that one person would prefer the entire buffer getting erased to hidden? |
@CoenraadS mentions a big one:
Another one is that when we do search, not being able to clear will cause issues for similar reasons as a bunch of old keywords that were explicitly cleared will get matched. |
I think this should be a setting because Windows and Linux shells behave differently and I don't see that listed in the roundup. Cmd and Powershell clear the buffer when cls is called so you can't scroll to see history. Here is what I think is needed to fully resolve this:
|
This brings me to a really nice plugin idea: if you clear, the buffer gets cleared, but if you scroll up past the current fold, you will see a line "The previous output has been cleared, click here to view", which restores the output. It would behave similar to a code editor where you can expand / collapse sections, but our sections are grouped by clear commands. Would modifying the scrollback like that actually work as a plugin currently?
![fold-clear](https://cloud.githubusercontent.com/assets/2785983/23549364/2cf2f8f2-000c-11e7-9613-4f5e388307bc.png)
|
@mofux |
+1 for actually clearing the screen. I share @CoenraadS 's use case where I use it for unit tests |
I confirm that running This Code command will produce same result
Workaround, use the clear terminal command from the palette or edit the keybinding removing the
Unfortunately you won't be able to run this shortkey successfully when terminal has focus. This need to be fixed. |
I would greatly appreciate a fix, I have to keep killing the terminal windows and re-opening to clear. It's very flow-breaking. |
So is there any intention to fixing this any time soon? This is the 1 thing holding me back from dropping ISE and moving into VSCode. I've been waiting for a fix for about a year now :-/ |
@Cookiecrumbles this has been fixed for me in VSCode Insider's build for months |
I had the issue in Insiders 1.8, that was the last one i had. I'll download the latest and give this a try. |
@chrisdothtml
I'm still able to scroll upwards and see previous GCI of c:\temp. |
Ah, I'm on a Mac. Probably wasn't fixed for Windows yet |
I'm guessing this isn't high on their priority list. Kinda gave up on VSCode just because of this. Back to ISE it is, i'll check back in six months or so, hoping it got fixed by then. #FeelsBadMan |
We support both clearing the viewport (2J) and the scrollback buffer (3J), not sure there is a fix for this for Linux/macOS other than including xterm.js in terminfo, see https://unix.stackexchange.com/questions/375743/why-clear-do-not-clear-whole-screen As for Windows, I'm not sure if there's anything that can be done on our side either. @rprichard any ideas why winpty would send only |
@Tyriar fix please asap. This is expected behaviour 101 for over 20 years of windows terminals. Can it really be hard to have windows clear it's entire buffer from that signal? |
winpty definitely notices when the My impression has been that clearing the screen doesn't reset the scrollback, but it looks like I was wrong, so maybe winpty needs to be changed here. |
@rprichard I think on Windows in particularly |
Well, i'm glad to see it's being looked at. I hope you guys can fix it in the near future. |
Any update @Tyriar ? |
is there any way to make this with flag? because, for long outputs, it really kills UX, where I expect to clear the screen, not push it up. Or can you detect OS and behave that way?
|
Any updates? Still an issue in VS Code and they seem to be waiting on this rather than fixing it in VS Code. |
|
Update: I expect this to be fixed when microsoft/vscode#45693 is addressed, which I will likely be working on in the coming months. |
Closing this as it's not related to xterm.js but the pty emulation on Windows. Windows pty issues are being tracked in microsoft/vscode#45693 |
Steps to reproduce:
ll
twice in to fill the viewportclear
The text was updated successfully, but these errors were encountered: