PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.71k stars 491 forks source link

The color parameter of Write-Host in DGB mode is invalid #3299

Closed Andy-AO closed 3 years ago

Andy-AO commented 3 years ago

Issue Description

The color parameter of Write-Host in DGB mode is invalid. (Using ASCII to describe colors is effective)

Expected Behaviour

image

Actual Behaviour

image

System Details

VSCode version: 1.52.1 ea3859d4ba2f3e577a159bc91e3074c5d85c0523 x64

VSCode extensions:

adamerose.better-outline@0.1.0 adamvoss.vscode-languagetool@3.8.0 adamvoss.vscode-languagetool-zh@3.8.0 alireza94.theme-gotham@0.4.0 almenon.arepl@2.0.2 andys8.jest-snippets@1.8.0 betterthantomorrow.calva@2.0.185 borkdude.clj-kondo@2021.3.310 casualjim.theme-desertex@0.0.6 cweijan.vscode-autohotkey-plus@2.6.2 DavidWang.ini-for-vscode@0.0.4 dbaeumer.vscode-eslint@2.1.16 emilast.LogFileHighlighter@2.11.0 Equinusocio.vsc-community-material-theme@1.4.2 Equinusocio.vsc-material-theme@33.2.0 equinusocio.vsc-material-theme-icons@1.2.2 eryouhao.brackets-light-pro@0.4.4 firsttris.vscode-jest-runner@0.4.31 formulahendry.code-runner@0.11.2 Gruntfuggly.auto-snippet@0.0.10 hbenl.vscode-test-explorer@2.19.6 helsmy.autohotkey-debug@0.6.12 Hyzeta.vscode-theme-github-light@7.14.2 IBM.output-colorizer@0.1.2 intellsmi.comment-translate@1.4.2 ionutvmi.reg@1.0.2 jeremyrajan.webpack@2.2.0 loilo.snazzy-light@1.1.7 lonefy.vscode-JS-CSS-HTML-formatter@0.2.3 lostfields.nodejs-repl@0.5.15 luokai.translate@2.1.0 luqimin.tiny-light@0.7.2 mdickin.markdown-shortcuts@0.12.0 mechatroner.rainbow-csv@1.8.1 MS-CEINTL.vscode-language-pack-zh-hans@1.54.2 ms-dotnettools.csharp@1.23.9 ms-python.python@2021.2.633441544 ms-toolsai.jupyter@2021.2.576440691 ms-vscode.cmake-tools@1.6.0 ms-vscode.cpptools@1.2.2 ms-vscode.powershell@2021.2.2 mushan.vscode-paste-image@1.0.4 octref.vetur@0.33.1 oderwat.indent-rainbow@7.5.0 onpaik.save-and-run-reg@0.1.3 rahmanyerli.fresh-light@1.1.0 redhat.java@0.76.0 royaction.color-manager@0.6.2 ryan-wdy.eyes-theme@1.1.8 selfrefactor.niketa-theme@9.22.0 SharzyL.cjk-word-handler@0.1.1 SirTori.indenticator@0.7.0 SolarLiner.linux-themes@1.0.1 telesoho.vscode-markdown-paste-image@0.12.3 thenikso.github-plus-theme@1.2.1 tht13.html-preview-vscode@0.2.5 tomconte.kickassembler@0.0.2 tranhl.find-then-jump@2.0.4 twxs.cmake@0.0.17 TylerLeonhardt.vscode-pester-test-adapter@0.0.23 uloco.theme-bluloco-light@3.3.7 VisualStudioExptTeam.vscodeintellicode@1.2.12 vscjava.vscode-java-debug@0.31.0 vscjava.vscode-java-dependency@0.18.1 vscjava.vscode-java-pack@0.13.0 vscjava.vscode-java-test@0.28.1 vscjava.vscode-maven@0.28.0 vscodevim.vim@1.19.3 WallabyJs.quokka-vscode@1.0.354 XadillaX.viml@1.0.1 yedhrab.yautohotkey@1.1.3 yzhang.markdown-all-in-one@3.4.0 ZacharyJia.quick-chinese-deletion@0.1.2 zero-plusplus.vscode-autohotkey-debug@1.6.9

PSES version: 2.3.0.0

PowerShell version:

Name Value


PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.18363 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

SydneyhSmith commented 3 years ago

Thanks @Andy-AO this reproduces outside of VSCode with the PowerShell debugger indicating MicrosoftTeams-image (1)

rjmholt commented 3 years ago

This is a common issue with all PowerShell Hosts. For example it also afflicts pwsh.exe and powershell.exe:

image

When things are run in the debugger, they don't print to the host as normal and the same richness isn't available. This is something that needs to be addressed architecturally by PowerShell.