Consider allowing users to disable E3 scrollback clear behavior of CSI J #12011

Open
opened 2026-01-31 03:03:54 +00:00 by claunia · 0 comments
Owner

Originally created by @naikel on GitHub (Jan 10, 2021).

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.685]
Windows Terminal version (if applicable): 1.4.3243.0

Any other software?

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.

Originally created by @naikel on GitHub (Jan 10, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19042.685] Windows Terminal version (if applicable): 1.4.3243.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Open any kind of terminal like WSL and type clear (bash) or a cmd.exe and type cls. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> 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 <!-- What's actually happening? --> 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.
claunia added the Issue-FeaturePriority-3Area-VTNeeds-Tag-FixProduct-Terminal labels 2026-01-31 03:03:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12011