Ever since upgrading to Windows 10 1809 clearing the screen using Ctrl+L no longer works as expected. I have observed the same behavior on at least 3 separate machines so the problem is easily reproduced.
Example:
[Ctrl+L]
ls
When I press Ctrl+L the screen is cleared as expected but as soon as type any character the scroll position is reverted and all text comes back.
Screen should remain cleared even when I start typing again.
clear
actually properly clears the buffer and does not suffer from this problemWSL does not suffer from this problem even using the new console host.
I can repro that.
It seems related
https://github.com/lzybkr/PSReadLine/issues/854#issuecomment-462411250
Are you using a non-en-US keyboard layout?
I'm reproducing this alongside this weird variant of #841, on Windows 10 1809.
@Boboss74 I'm using es-ES layout but I can't reproduce #854.
It seems this is a conhost bug, see https://github.com/PowerShell/PowerShell/issues/8870#issuecomment-464188918 which points to https://github.com/Microsoft/console/issues/302.
Yeah, definitely conhost issue. The Clear-Host cmdlet works as expected as it uses the regular console API instead of a VT sequence.
Now that Windows 10 1903 is finally released and I have updated three machines and can confirm that the update does indeed resolve the issue. Thanks for the help!
Most helpful comment
It seems this is a conhost bug, see https://github.com/PowerShell/PowerShell/issues/8870#issuecomment-464188918 which points to https://github.com/Microsoft/console/issues/302.