Terminal profiles in IDEs
I spend a significant part of my work day in a terminal. That's why I have it configured to suit my needs with a collection of several useful modules which I occasionally still extend. Although all IDEs I regularly use feature an integrated terminal which opens in repository root by default, I rarely used them because they didn't match my configuration. So I decided to check if there was a way to make them use my default PowerShell profile.
Visual Studio Code was the only IDE which did that for me by default. As documented, it detected many available shells and chose as default the new version 7 of PowerShell, which I'm using daily as well. Both PowerShell versions were also listed among detected shells:
This means that I could easily select the desired shell as default if it wasn't auto-detected correctly:
"terminal.integrated.defaultProfile.windows": "PowerShell"
Visual Studio 2022 by default only listed two of its own developer shells (command prompt and the old version 5 of PowerShell). However, in the Options dialog you can add your own shell configurations and select any one of them as default.
The simplest way to find the location of the PowerShell 7 executable is to invoke the following command from your own PowerShell terminal window:
(gcm pwsh.exe).Path
The actual location will differ depending on how you have installed PowerShell. I have done it from the Microsoft Store.
All JetBrains tools (I'm using IntelliJ IDEA and Rider regularly) picked the old version 5 PowerShell as default for me and didn't provide the new version 7 PowerShell as one of the options. I could add it myself in the Settings dialog, however:
I only had to set the path to pwsh.exe
executable as Shell path. It's the same path I used for Visual Studio 2022 configuration.
Fortunately, all IDEs I'm using provide enough configuration settings to allow the integrated terminal window to use the same shell configuration I'm using in my system terminal. I'm certain I will now be using their terminal feature more often than before.