Skip to content

PS Integrated Console incorrect width #865

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
thomasrayner opened this issue Jan 25, 2019 · 4 comments · Fixed by #874
Closed

PS Integrated Console incorrect width #865

thomasrayner opened this issue Jan 25, 2019 · 4 comments · Fixed by #874

Comments

@thomasrayner
Copy link

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.

image

This is how it looks in the PSIC. I did not resize VS Code between these two screenshots.

image

@thomasrayner
Copy link
Author

It looks like $host.ui.rawui.buffersize.width is correct so this isn't that big a deal, but it'd still be nice if the values were correct.

@vexx32
Copy link

vexx32 commented Jan 25, 2019

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.)

😄

@TylerLeonhardt
Copy link
Member

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 :)

@SeeminglyScience
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants