Visual Studio Code 1.2.0 is out now, and includes a variety of exciting new features. For example, a new integrated Terminal that allows you to stay within VS Code while using your platform’s shell. You may have also heard that Bash support has been added to Windows 10 in the current Windows Insider Preview. Hmmm???
In this post, we will show how to enable the Bash for Windows as an integrated terminal within Visual Studio Code =)
Requirements:
- PC running Windows 10
Part 1 – Installing Bash on Ubuntu on Windows
Step 1:
- Bash support for Windows will require enrollment in Windows Inside Preview Builds (Settings => Update & Security => Windows Insider Program)
Step 2:
- Ensure you are on Windows Insider Preview Build 14316 or above (Settings => System => About)
Step 3:
- Enable Windows Subsystem for Linux in Windows Features and reboot if you are enabling for the first time
Step 4:
- Install Bash for Windows (type “bash” on start menu then hit Enter to run the installer)
Part 2 – Adding Bash for Windows as Integrated Terminal in VS Code
Step 1:
Step 2:
- Modify User Settings in VS Code (File => Preferences => User Settings) and add the following within the settings.json pane:
- “terminal.integrated.shell.windows”: “C:\\Windows\\sysnative\\bash.exe”
You can now toggle the terminal view with CTRL+` or (View => Toggle Integrated Terminal)
To quote Dashel Robert Parr from The Incredibles, “That’s totally awesome!”
Thanks for the config!
Hey this is great, thanks for info.
I don’t think you need to enroll in Windows Inside Preview Builds anymore. I needed to go to “Turn windows features on or off” and switch on developer mode.
Cheers mate, that worked first time. I linked you from a similar StackOverflow question. Hope you don’t mind.
https://stackoverflow.com/questions/42606837/how-to-use-bash-on-windows-from-visual-studio-code-integrated-terminal/48655329#48655329
You saved my computer science class. Thank you SO much and I’ll always remember you.
lol cheese.