VSCode Change Default Terminal
Solution 1
You can also select your default terminal by pressing F1 in VS Code and typing/selecting Terminal: Select Default Profile
(or Terminal: Select Default Shell
in older VSCode versions).
Older:
Solution 2
Configure your default integrated terminal by running the Terminal: Select Default Profile command, which is also accessible via the terminal dropdown.
See https://code.visualstudio.com/docs/editor/integrated-terminal#_terminal-profiles
Solution 3
I just type following keywords in the opened terminal;
- powershell
- bash
- cmd
- node
- python (or python3)
See details in the below image. (VSCode version 1.19.1 - windows 10 OS)
It works on VS Code Mac as well. I tried it with VSCode (Version 1.20.1)
Solution 4
Go to File > Preferences > Settings
(or press Ctrl+,) then click the leftmost icon in the top right corner, "Open Settings (JSON)"
In the JSON settings window, add this (within the curly braces {}
):
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe"`
(Here you can put any other custom settings you want as well)
Checkout that path to make sure your bash.exe file is there otherwise find out where it is and point to that path instead.
Now if you open a new terminal window in VS Code, it should open with bash instead of PowerShell.
Solution 5
Since you use WSL, VSCode has dedicated Remote - WSL extension so you can use Linux environment directly in VSCode. When you open the project inside Linux, by default, it's use Linux default shell (bash by default), so no config needed.
If you want to switch to other profile, there is Terminal > Integrated > Default Profile: Linux section so you can pick your favorite one.
Related videos on Youtube
Comments
-
abhijeetps almost 2 years
I am using Visual Studio Code on my Windows 10 PC. I want to change my default terminal from Windows PowerShell to Bash on Ubuntu (on Windows).
How can I do that?
-
RBT almost 6 years
-
BuZZ-dEE almost 4 yearsDoes this answer your question? How to select a different type of command shell in the Visual Studio Code integrated terminal
-
-
winterlight over 5 yearsSeems to work only when
bash
is selected as default shell. -
sorin over 5 yearsAs of today on MacOS the Terminal extension does not have a "Select Default Shell" option in the menu! Lucky for me using stackoverflow.com/a/49916667/99834 worked.
-
Barabas over 5 yearsWithout this extension Shell launcher this answer is useless. So just install it and specify shortcut. Be careful, this shortcut is already defined - find this shortcut and check if you use action under this shortcut or not.
-
dmoore1181 almost 5 yearsIt appears that VSCode has changed a little since this answer, now there is a button with {} on it that you must press to get to the editor to make this change. The command in this answer did work correctly. Thank you for the answer.
-
cakidnyc over 4 yearsI'm using MacOS Catalina right now, "Terminal: Select Default Shell" was there and worked for me.
-
Ollie over 3 yearsWas searching for a way to open my wsl on windows without changing the default, creating new, then switching default back to powershell. Simply typing
wsl
works an absolute charm -
Sergio Escudero about 3 yearsYou should not use the executable from System32 since (normally) vs code has no access to that executable. Instead use the program files one
terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
-
Sergio Escudero about 3 yearsOutdated answer. Not working for the new VS code versions
-
Meeting Attender almost 3 yearsThis is the correct and most recent way of doing it, however, it doesn't work for me in VS Code v1.56.2. This works "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe"
-
arielhad almost 3 yearsWhen im trying to use "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe" Im getting this warning - "This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile" (VS Code v1.56.2)
-
Meeting Attender almost 3 yearsI’m getting the same deprecated warning but at least it works. Like I said recommended way isn’t working for me on v1.56.2.
-
Drovosek almost 3 yearsNot work for me in VSCode 1.56.2 too. Use deprecated way, it works.
-
Kevin Danikowski almost 3 yearsUpdated Answer for Linux and MAC: askubuntu.com/a/1118140/810954
-
Ray Foss almost 3 yearsThere is a Small drop down that says Select Default Profile... that sets the current shell as the default profile.
-
Abhishek Dutt almost 3 yearsLol, what makes this answer different from @OneShadow 's answer. Please elaborate more on it.
-
Chuck L almost 3 yearsNot working in VSCode 1.57.1, HOWEVER, if you remove "source": "Git Bash" AND change the name from "Git Bash" to something like "GitBash", it works. Is there a bug???
-
Jatin Mandanka over 2 yearsWorked like a charm . Thanks.
-
Olli over 2 years
"terminal.integrated.shell.windows"
or"terminal.integrated.shell.linux"
is deprecated and it did not seem to work in my case (v1.62.0 on linux). Use"terminal.integrated.defaultProfile.windows"
or"terminal.integrated.shell.linux"
instead and define the executable path in the"terminal.integrated.profiles.windows"
or"terminal.integrated.profiles.linux"
, repectively. See also @Stephanieraymos answer below. -
heretoinfinity about 2 yearsHas this changed because I have done this on Windows version 1.65.2 and every time there is a restart, I get the powershell instead of Git bash
-
Timo about 2 yearsIt should be the correct answer, because the OP wants to switch from Windows to Linux in Vscode which is only possible with Remote WSL I guess.
-
Timo about 2 yearsI have
terminal.integrated.defaultProfile.linux
andterminal.integrated.defaultProfile.windows
andterminal.integrated.defaultProfile.osx
. The magic three.. -
amordo almost 2 yearsI set fish as default shell on wsl, but vscode still used bash. Set this setting explicitly and now it works like a charms, ty!