WinCoder Blog

Bash on Windows as Integrated Terminal in Visual Studio Code

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)

Update

Step 2:

  • Ensure you are on Windows Insider Preview Build 14316 or above (Settings => System => About)

Version

Step 3:

  • Enable Windows Subsystem for Linux in Windows Features and reboot if you are enabling for the first time

Feature

Step 4:

  • Install Bash for Windows (type “bash” on start menu then hit Enter to run the installer)

Install

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”

VSCodeSettings

You can now toggle the terminal view with CTRL+` or (View => Toggle Integrated Terminal)


4 comments for “Bash on Windows as Integrated Terminal in Visual Studio Code

  1. Sean
    November 2, 2016 at 8:14 pm

    To quote Dashel Robert Parr from The Incredibles, “That’s totally awesome!”

    Thanks for the config!

  2. Davos
    April 5, 2017 at 6:38 am

    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.

  3. February 7, 2018 at 3:07 am

    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

  4. Arze Lu
    September 2, 2018 at 2:10 pm

    You saved my computer science class. Thank you SO much and I’ll always remember you.
    lol cheese.

Leave a Reply

Your email address will not be published. Required fields are marked *