-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Consider allowing users to disable E3 scrollback clear behavior of CSI J #8736
Comments
Well this is embarrassing and I'm sorry but after reading the OutputStateMachineEngine code and some other classes it seems that you fully support the extended E3 capability of the terminal, which nobody else does. So this is not really a obscure Microsoft reason after all. Since as far as I know all other emulators block the scrollback clear from the E3 extension I guess the fair solution here is a setting where a user can just block it. Implementation is fairly easy in TerminalApi.cpp just treating eraseType as DispatchTypes::EraseType::All always and ignoring DispatchTypes::EraseType::Scrollback if this setting is enabled. A sad workaround then is something like export TERM=vt100 which doesn't support the scrollback clear but then I'm missing a lot of features since I'd be using a terminal that's literally 42 years old. I'd still prefer an option to keep my scrollback forever. Also a historySize: 0 or -1 to disable the limit would be nice. I want my whole 32 gigs of RAM of scrollback! EDIT: Another workaround for WSL: alias clear='clear -x' |
Unfortunately I also realized that the historySize is a SHORT and a buffer of only 32,767 lines is not that very useful 😢. Infinite scrollback is very urgent. |
This might be a good lesson about making assumptions. We're generally good people with positive intent, and we try to document all of our decisions here in issues or in our docs folder. 😄 We definitely want infinite scrollback (#1410). I'm genuinely curious, though -- why would We're all trying to converge on a standard! |
I agree it should be backwards, the default behaviour should be just the screen and with an option to delete the screen + scrollback. ... but cls in cmd.exe does the same thing with no option to disable it. Same for clear/clear-host in PowerShell. There should be a way to stop this. |
Fair point. That one was a choice we made (pull request: #5627) due to overwhelming community desire. PowerShell and cmd outside of Terminal do destroy the user's scrollback, and folks found it jarring that it didn't do so in Terminal. #1305 and #3126, the issues tracking those complaints, had a total of 9 duplicates (disincluding the two main issues.) |
That's not really true though, right? I'd be willing to bet that this is something that varies from distro to distro and TERM to TERM.
I'm just gonna cc @j4james on this thread, cause he's usually interested in these sorts of matters. |
yeah... but some popular terminals like xfce4-terminal or even SecureCRT for Windows would never clear the scrollback. Again I'm not against the proper implementation of E3 standards, but since popular terminals would never kill the scrollback to you, I think it's fair for an option to avoid that, even if it's something never seen before in for example cmd.exe.
Arch
xterm-256color
|
I'll mark this up for backlog consideration to disable E3. Thanks! |
I would recommend either creating an alias for
install it with |
It does work on bash. |
Environment
Steps to reproduce
Open any kind of terminal like WSL and type clear (bash) or a cmd.exe and type cls.
Expected behavior
The screen should be cleared but the scroll back should not disappear. This is the behavior I would expect if I type clear/cls or send \033c to the terminal.
Actual behavior
The screen is cleared and the scrollback as well, and can't go back. In some environments the scrollback is cleared completely, in some others only the exact number of lines of the terminal are kept. If your terminal has 24 lines, then the last 24 onlines are kept (example ssh to a Linux box has this last lines are kept behavior).
I have used several terminal emulators and this is the first I see that does that. The scrollback is supposed to last forever, until a "Clear Scrollback" menu is selected or something. Clearing the screen should not clear the scrollback.
If this is indeed intended behavior for some obscure Microsoft reason can you at least implement an option to keep the scrollback when the screen is cleared?
Also if you can point me to some commits where this behavior was implemented I would really appreciate it so I can revert it in my dev version.
Workaround
A workaround at least for WSL is pressing Ctrl-L if you use a bash with no modified readline options and it will clear the screen and keep the scrollback, like it is supposed to.
The text was updated successfully, but these errors were encountered: