How do the change the shell used for VS Code's integrated terminal when I connect to an remote ssh workspace?
Connect to a remote host#In VS Code, select Remote-SSH: Connect to Host... from the Command Palette (F1, Ctrl+Shift+P) and use the same user@hostname as in step 1. If VS Code cannot automatically detect the type of server you are connecting to, you will be asked to select the type manually.
You can use remote setting to change the shell for each host. To do this, open the remote workspace in VS Code and run the Open Remote settings
command:
Set terminal.integrated.shell.linux
to point to your shell and save the file:
"terminal.integrated.shell.linux": "/usr/bin/fish"
The remote settings apply to all workspaces you open on a given host, but must be configured for each host you connect to.
Adding to @Matt Bierner's answer.
The newer versions of vscode
now lets you set up profiles for your terminal and give them your custom name and that name is supposed to be referenced in your remote settings.
CTRL+SHIFT+P -> Preferences: Open Settings (JSON)
user configs
...
"terminal.integrated.profiles.linux": {
"s-mann-term": {
"path": "/usr/bin/zsh"
},
"bash": {
"path": "bash"
},
"zsh": {
"path": "zsh"
},
"my-fav-term": {
"path": "fish"
}
},
"terminal.integrated.defaultProfile.linux": "s-mann-term"
...
This will make all hosts to default to /usr/bin/zsh
(I just used path
key in my profile but there are bunch of other options that you can modify)
NOTE: You can add multiple profiles for the same shell as well. For example, 5 differently configured
zsh
profiles.
CTRL+SHIFT+P -> Preferences: Open Remote Settings (SSH: az-box1)
az-box1 configs
...
"terminal.integrated.defaultProfile.linux": "my-fav-term"
...
But az-box1 will default to fish
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With