1809 PowerShell - Ctrl-L clears the screen, but next keystroke brings text back #443

Closed
opened 2026-01-30 21:52:30 +00:00 by claunia · 9 comments
Owner

Originally created by @AdamDotNet on GitHub (Nov 6, 2018).

  • Your Windows build number: 10.0.17763.55

  • What you're doing and what's happening: Open PowerShell, type in a few commands, and then clear the screen with ctrl-L. The text will disappear. Type anything else, and the cleared text comes back onto the screen.

  • What's wrong / what should be happening instead: Cleared text should remain cleared.

windows powershell 2018-11-06 13-19-44

Originally created by @AdamDotNet on GitHub (Nov 6, 2018). * Your Windows build number: 10.0.17763.55 * What you're doing and what's happening: Open PowerShell, type in a few commands, and then clear the screen with `ctrl-L`. The text will disappear. Type anything else, and the cleared text comes back onto the screen. * What's wrong / what should be happening instead: Cleared text should remain cleared. ![windows powershell 2018-11-06 13-19-44](https://user-images.githubusercontent.com/8978001/48091658-8a4f6280-e1c7-11e8-8a26-0b29c3ef29d3.gif)
claunia added the Resolution-DuplicateProduct-Powershell labels 2026-01-30 21:52:30 +00:00
Author
Owner

@Delivator commented on GitHub (Feb 3, 2019):

Any workaround/fix for this?

@Delivator commented on GitHub (Feb 3, 2019): Any workaround/fix for this?
Author
Owner

@The-Honey-Badger commented on GitHub (Feb 6, 2019):

I've been experiencing this for a while now. Would absolutely LOVE a fix.

@The-Honey-Badger commented on GitHub (Feb 6, 2019): I've been experiencing this for a while now. Would absolutely LOVE a fix.
Author
Owner

@fungiboletus commented on GitHub (Feb 18, 2019):

A workaround mentioned in some linked issues is to switch to a qwerty keyboard layout, like the US because obviously the testers forgot to test with various keyboard layouts, and once the console has started you can switch back to your normal layout (azerty, dvorak, bépo…).

@fungiboletus commented on GitHub (Feb 18, 2019): A workaround mentioned in some linked issues is to switch to a qwerty keyboard layout, like the US because obviously the testers forgot to test with various keyboard layouts, and once the console has started you can switch back to your normal layout (azerty, dvorak, bépo…).
Author
Owner

@zadjii-msft commented on GitHub (Feb 19, 2019):

I'm actually 80-90% sure that this is caused by the same root cause as #270, and that fix should be in insiders currently.

For the record, one of the console devs actually does use Coleman as his keyboard layout, so yes, we do test other layouts😜


From: Antoine Pultier notifications@github.com
Sent: Monday, February 18, 2019 12:55:36 AM
To: Microsoft/console
Cc: Subscribed
Subject: Re: [Microsoft/console] 1809 PowerShell - Ctrl-L clears the screen, but next keystroke brings text back (#302)

A workaround mentioned in some linked issues is to switch to a qwerty keyboard layout, like the US because obviously the testers forgot to test with various keyboard layouts, and once the console has started you can switch back to your normal layout (azerty, dvorak, bépo…).


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F302%23issuecomment-464642899&data=02%7C01%7CMike.Griese%40microsoft.com%7C54ff2ecf924045ee3a0208d6957ed96b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636860769381544945&sdata=tGBIpJpuCEp1gMVXw5fhBP0FmrFgqHqozxDabBrf6nM%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARgZ1mPhCeYWDqADjFKKYPzuiVuSVydQks5vOmqIgaJpZM4YRNxH&data=02%7C01%7CMike.Griese%40microsoft.com%7C54ff2ecf924045ee3a0208d6957ed96b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636860769381554953&sdata=MtAqRN82pdLkJjSsRZDAkw2G0R3SD6D3v0Gm4J4uUJo%3D&reserved=0.

@zadjii-msft commented on GitHub (Feb 19, 2019): I'm actually 80-90% sure that this is caused by the same root cause as #270, and that fix should be in insiders currently. For the record, one of the console devs actually does use Coleman as his keyboard layout, so yes, we do test other layouts😜 ________________________________ From: Antoine Pultier <notifications@github.com> Sent: Monday, February 18, 2019 12:55:36 AM To: Microsoft/console Cc: Subscribed Subject: Re: [Microsoft/console] 1809 PowerShell - Ctrl-L clears the screen, but next keystroke brings text back (#302) A workaround mentioned in some linked issues is to switch to a qwerty keyboard layout, like the US because obviously the testers forgot to test with various keyboard layouts, and once the console has started you can switch back to your normal layout (azerty, dvorak, bépo…). — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2Fconsole%2Fissues%2F302%23issuecomment-464642899&data=02%7C01%7CMike.Griese%40microsoft.com%7C54ff2ecf924045ee3a0208d6957ed96b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636860769381544945&sdata=tGBIpJpuCEp1gMVXw5fhBP0FmrFgqHqozxDabBrf6nM%3D&reserved=0>, or mute the thread<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FARgZ1mPhCeYWDqADjFKKYPzuiVuSVydQks5vOmqIgaJpZM4YRNxH&data=02%7C01%7CMike.Griese%40microsoft.com%7C54ff2ecf924045ee3a0208d6957ed96b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636860769381554953&sdata=MtAqRN82pdLkJjSsRZDAkw2G0R3SD6D3v0Gm4J4uUJo%3D&reserved=0>.
Author
Owner

@The-Honey-Badger commented on GitHub (Apr 28, 2019):

Any update on this?? Still having the issue on 1809 Build 17763.437 with PSVersion 5.1.17763.316 and would really like a workaround/patch given that I've been experiencing this bug since October of 2018... I'm willing to do just about anything to bring back my CTRL+L. I've tried to re-create the CTRL+L function manually via the following custom PSReadLineKeyHandler chord:

Set-PSReadLineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock {
	$line = $null
	$cursor = $null
	#get the current line
	[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
	[Microsoft.PowerShell.PSConsoleReadLine]::BackwardKillLine()
	[Microsoft.PowerShell.PSConsoleReadLine]::ClearScreen()
	[Microsoft.PowerShell.PSConsoleReadLine]::Insert($line)
}

However this does not work, so I tried replacing ClearScreen() with the Clear-Host cmdlet but that will just clear the screen but the cursor buffer stays in the same spot. Looking into it further, it looks like the real problem is from the [Microsoft.PowerShell.PSConsoleReadLine]::ScrollDisplay* function which (as far as I can tell) does absolutely nothing. Not sure where to go from here, but hopefully this gets fixed soon.

@The-Honey-Badger commented on GitHub (Apr 28, 2019): Any update on this?? Still having the issue on 1809 Build 17763.437 with PSVersion 5.1.17763.316 and would really like a workaround/patch given that I've been experiencing this bug since October of 2018... I'm willing to do just about anything to bring back my CTRL+L. I've tried to re-create the CTRL+L function manually via the following custom PSReadLineKeyHandler chord: ``` Set-PSReadLineKeyHandler -Chord Ctrl+Shift+B -ScriptBlock { $line = $null $cursor = $null #get the current line [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor) [Microsoft.PowerShell.PSConsoleReadLine]::BackwardKillLine() [Microsoft.PowerShell.PSConsoleReadLine]::ClearScreen() [Microsoft.PowerShell.PSConsoleReadLine]::Insert($line) } ``` However this does not work, so I tried replacing ClearScreen() with the Clear-Host cmdlet but that will just clear the screen but the cursor buffer stays in the same spot. Looking into it further, it looks like the real problem is from the [Microsoft.PowerShell.PSConsoleReadLine]::ScrollDisplay* function which (as far as I can tell) does absolutely nothing. Not sure where to go from here, but hopefully this gets fixed soon.
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2019):

@The-Honey-Badger The fix for this bug is in Windows 1903 - See #270 for more details.

@zadjii-msft commented on GitHub (Apr 29, 2019): @The-Honey-Badger The fix for this bug is in Windows 1903 - See #270 for more details.
Author
Owner

@j0rdan0 commented on GitHub (Oct 22, 2023):

This is still happening on:

OS Name: Microsoft Windows Server 2019 Datacenter
OS Version: 10.0.17763 N/A Build 17763

Any fixes for this bug for this version it is very annoying, especially for someone coming from Linux environment where CTRL-L always worked for clearing screen.

@j0rdan0 commented on GitHub (Oct 22, 2023): This is still happening on: OS Name: Microsoft Windows Server 2019 Datacenter OS Version: 10.0.17763 N/A Build 17763 Any fixes for this bug for this version it is very annoying, especially for someone coming from Linux environment where CTRL-L always worked for clearing screen.
Author
Owner

@DHowett commented on GitHub (Oct 23, 2023):

I'm sorry. Fixes for bugs like this don't meet the relatively high bar for servicing to versions of Windows that are that old.

@DHowett commented on GitHub (Oct 23, 2023): I'm sorry. Fixes for bugs like this don't meet the relatively high bar for servicing to versions of Windows that are that old.
Author
Owner

@EGL20FL commented on GitHub (Apr 1, 2024):

cls - old clear working in this case)

@EGL20FL commented on GitHub (Apr 1, 2024): cls - old clear working in this case)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#443