You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It doesn't look like the PS Integrated Console in VS Code actually knows how wide it is. In regular PowerShell.exe (or pwsh, if you prefer), you can look in $host.ui.rawui.maxwindowsize.width and get the number of cols wide the console is. In the PSIC in VS Code, this number is wrong.
If you run write-host $(" " * $host.ui.rawui.maxwindowsize.width) -nonewline; "HERE", it should effectively write a blank line (space chars all the way across your screen) and then "HERE". The "HERE" should be on the start of it's own line. This is how it looks in the regular PowerShell console in VS Code.
This is how it looks in the PSIC. I did not resize VS Code between these two screenshots.
The text was updated successfully, but these errors were encountered:
Yes, please populate with proper values... Don't be another ISE. 😉 (ISE doesn't populate $host.RawUI.WindowSize at all, so this is still better, but... c'mon.)
IIRC @SeeminglyScience mentioned that $host is set when we first start up PSES (because we start it up IN pwsh), but is thrown away. This might be one of the things that can be preserved from the initial $host and get for free :)
IIRC @SeeminglyScience mentioned that $host is set when we first start up PSES (because we start it up IN pwsh), but is thrown away. This might be one of the things that can be preserved from the initial $host and get for free :)
Yep. Right now it's just a constant, but we can definitely reuse ConsoleHost here.
It doesn't look like the PS Integrated Console in VS Code actually knows how wide it is. In regular PowerShell.exe (or pwsh, if you prefer), you can look in
$host.ui.rawui.maxwindowsize.width
and get the number of cols wide the console is. In the PSIC in VS Code, this number is wrong.If you run
write-host $(" " * $host.ui.rawui.maxwindowsize.width) -nonewline; "HERE"
, it should effectively write a blank line (space chars all the way across your screen) and then "HERE". The "HERE" should be on the start of it's own line. This is how it looks in the regular PowerShell console in VS Code.This is how it looks in the PSIC. I did not resize VS Code between these two screenshots.
The text was updated successfully, but these errors were encountered: