PowerShell / PowerShellEditorServices

A common platform for PowerShell development support in any editor or application!
MIT License
625 stars 215 forks source link

Host needs updating for $psStyle #1645

Open jhoneill opened 2 years ago

jhoneill commented 2 years ago

I filed an issue on the mail PowerShell project https://github.com/PowerShell/PowerShell/issues/16643 Basically hosts other than "ConsoleHost" - including the Visual Studio Code Host need to be updated so that when $PSStyle.OutputRendering is set to plaintext Ansi colours are not sent to the terminal

image

Above you can see the green row labels in the PowerShell Integrated Console. Below you can see they're mono in the PWSH console.

image

What I'm being told over there is that fix goes with the host. hence creating this one.

andyleejordan commented 2 years ago

Thanks for the bug report @jhoneill! We have a lot of work to do for the integrated console's host, especially with respect to the new PSStyle APIs.

jhoneill commented 2 years ago

@andschwa See also https://github.com/PowerShell/PowerShell/issues/16643
There's a discussion going on about whether this should be in host, and if it reasonable to drop this work onto you.

JustinGrote commented 2 years ago

FWIW the latest preview seems to work in both Host and Ansi mode, except for exceptions: image image

Detailmode kind of works but clearly has issues: image

andyleejordan commented 2 years ago

Sweet, looks like things are improving! Patrick had the idea of redirecting the host's PrivateData field to the underlying console host, and not that I know much about this but it seems to have made more host things work?