How can I customize powershell when running inside of the VSCode integrated terminal?

后端 未结 4 1646
南笙
南笙 2020-12-11 08:50

I would like to include a few Powershell customizations that only occur when running inside of VSCode.

When inside of ISE or Package Management Console (inside Vis

4条回答
  •  天命终不由人
    2020-12-11 09:11

    VSCode sets the TERM_PROGRAM environment variable to vscode in its integrated terminal, so you can use the following test, which works whether or not the PowerShell extension is installed:

    $runningInVsCode = $env:TERM_PROGRAM -eq 'vscode'
    

提交回复
热议问题