Ctrl-L leaves the screen dirty #160

Closed
opened 2026-01-30 21:44:11 +00:00 by claunia · 3 comments
Owner

Originally created by @bitcrazed on GitHub (Feb 16, 2018).

From @Alebat on April 21, 2017 18:0

Microsoft Windows [Version 10.0.14393]

When I press Ctrl-L after scrolling up in BashOnWindows the text in the window view is canceled but not the part hidden after the last line.

When I need to clear the screen I often press Ctrl-L instead of calling the clear command (https://ss64.com/bash/syntax-keyboard.html). This issue does not show up with clear due to the window scroll after pressing enter.

I think that when Ctrl-L is pressed the window should scroll to the prompt before doing anything else. Now it is the prompt that moves to the top of the window, without any scrolling.

This issue may or not be realted to #1756

Copied from original issue: Microsoft/WSL#1978

Originally created by @bitcrazed on GitHub (Feb 16, 2018). _From @Alebat on April 21, 2017 18:0_ Microsoft Windows [Version 10.0.14393] **When I press Ctrl-L after scrolling up** in BashOnWindows the text in the window view is canceled but not the part hidden after the last line. When I need to clear the screen I often press **Ctrl-L** instead of calling the `clear` command (https://ss64.com/bash/syntax-keyboard.html). This issue does not show up with `clear` due to the window scroll after pressing enter. I think that when **Ctrl-L** is pressed the window **should scroll to the prompt before** doing anything else. Now it is the prompt that moves to the top of the window, without any scrolling. This issue may or not be realted to #1756 _Copied from original issue: Microsoft/WSL#1978_
claunia added the Product-ConhostResolution-Fix-Available labels 2026-01-30 21:44:11 +00:00
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @sunilmut on April 21, 2017 21:2

@Alebat - Thanks for your post. Looks console related. We have done some significant investments in console + WSL in the CU build (15063). Looks like you are still on AU (build 14393). Are you able to move to CU and try this out again? I played around with Ctrl+L a little in CU and it seems to be consistent with native Ubuntu experience.

@bitcrazed commented on GitHub (Feb 16, 2018): _From @sunilmut on April 21, 2017 21:2_ @Alebat - Thanks for your post. Looks console related. We have done some significant investments in console + WSL in the CU build (15063). Looks like you are still on AU (build 14393). Are you able to move to CU and try this out again? I played around with Ctrl+L a little in CU and it seems to be consistent with native Ubuntu experience.
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @zadjii-msft on April 24, 2017 15:51

@Alebat Yea, I see what you're seeing, even on CU. I've filed MSFT:11765830 on our internal work tracker to make sure this gets investigated.

I did add support for CSI 3 J (clear scrollback) last release, but I can't remember off the top of my head if that is what C-l emits in bash. IIRC, it only emits CSI 2 J (Clear screen), which would make this the "working as intended" behavior. I'd be cautious to try and change that behavior to include scrolling to the cursor position, this may just be one of those cases where the inherent differences between a Windows and Linux console aren't entirely reconcilable.

That being said, it could be something else. We'll see.

@bitcrazed commented on GitHub (Feb 16, 2018): _From @zadjii-msft on April 24, 2017 15:51_ @Alebat Yea, I see what you're seeing, even on CU. I've filed MSFT:11765830 on our internal work tracker to make sure this gets investigated. I did add support for `CSI 3 J` (clear scrollback) last release, but I can't remember off the top of my head if that is what `C-l` emits in bash. IIRC, it only emits `CSI 2 J` (Clear screen), which would make this the "working as intended" behavior. I'd be cautious to try and change that behavior to include scrolling to the cursor position, this may just be one of those cases where the inherent differences between a Windows and Linux console aren't entirely reconcilable. That being said, it could be something else. We'll see.
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @zadjii-msft on June 8, 2017 23:14

Hey, I submitted a fix for this earlier this week. Should be out to Insiders in about a month :)

@bitcrazed commented on GitHub (Feb 16, 2018): _From @zadjii-msft on June 8, 2017 23:14_ Hey, I submitted a fix for this earlier this week. Should be out to Insiders in about a month :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#160