Last active
November 18, 2021 23:03
-
-
Save drichardson/195db36121cf4de10be03c9fc1198b63 to your computer and use it in GitHub Desktop.
Powershell Reset - Remove horizontal scrollbar and clear
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reset { | |
Set-Buffer-Width-To-Screen-Width | |
Clear-Host | |
} | |
function Set-Buffer-Width-To-Screen-Width { | |
$h = Get-Host | |
$ui = $h.UI.RawUI | |
$bufferSize = $ui.BufferSize | |
$windowSize = $ui.WindowSize | |
$bufferSize.Width = $windowSize.Width | |
$ui.BufferSize = $bufferSize | |
} |
Thanks for writing out this workaround
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needless to say one needs to add bufferSize.Height = windowsize.Height to also remove the vertical scrollbar.
Thanks for the advice champ. Makes my shell look an awful lot prettier and neater.