I received the recent update for VS Code with pleasant surprises for the Integrated Terminal! Most importantly, it now defaults to Powershell. This can be changed using VS Code settings. This ability is not necessarily a new option within VS Code but, if you rather your own shell, then here we go!
To access VS Code settings, use the menu under File > Preferences and click Settings. A settings.json file opens with a list of Default Settings. These can be copied to your workspace or user settings.
With the Settings open, finding settings is easy – just type the setting name (or scroll) as shown in Figure 1.
Bring Your Own Shell
According to VS Code Documentation, a different shell executable can be used given that it adheres to this very important requirement:
..the shell executable must be a console application so that
stdin/stdout/stderrcan be redirected..
This offers a lot of flexibility to support your given scenario and preferences. Update the shell using the format: “terminal.integrated.shell.platform”: “full path to shell executable”. For example, when specifying the setting for Windows this would be similar to:
Arguments can be passed to this executable using the following format: “terminal.integrated.shellArgs.platform”: [“arg1”, …]. Specifying the setting for Windows would be similar to:
"terminal.integrated.shellArgs.windows": ["Get-Help", "*"]
"terminal.integrated.shellArgs.windows": ["Get-Help *"]
With those sample arguments, the terminal window will close after the help text displays for Powershell. While that is less than useful, the settings are there for your benefit. Choose the shell you want within VS Code and configure it accordingly. Of course, make sure you first have it installed.
I’m sure you all noticed the “platform” placeholder within the setting formats. Currently the platforms for terminal settings specified within VS Code are:
VS Code is awesome, what do you think? I am eager to hear of your experiences using Visual Studio Code!