Photo by Jess Bailey on Unsplash
Integrate Cygwin's Bash in VS Code
Use Cygwin's Bash in VS Code Terminal
What is Cygwin?
Cygwin is a collection of open source tools that allows source code designed for Unix-like operating systems to compile and execute in Microsoft Windows OS.
Setup the system
You can download the installer from this link. You need to remember the location of installer (recommended C:\cygwin_installer) which is referred in next section.You can follow the steps in this video to install it in your windows OS.
Note: You need to install Cygwin in your windows system to follow next section.
Guidelines to integrate cygwin bash to vs code
- Open VS code market place by clicking on extensions icon in Activity Bar or shortcut
Ctrl+Shift+X
- Search for Shell launcher by Daniel Imms and install it.
- Open keybindings.json file by clicking shortcut
Ctrl+Shift+P
and search for keybindings.json. We are including shortcutCtrl+Shift+T
to show list of all terminal shell. Add below code in the list{ "key": "ctrl+shift+t", "command": "shellLauncher.launch" }
- Open settings.json by clicking shortcut
Ctrl+Shift+P
and search for settings.json. After opening settings.json, search for shellLauncher.shells.windows object and add below code in starting of the list
Note: Path to bash.exe may be different in your system. Please modify as per your local system.{ "shell": "C:\\cygwin64\\bin\\bash.exe", "args": ["--login"], "label": "Cygwin Bash", "launchName": "Cygwin Bash" },
After saving the settings in keybindings.json and settings.json, Ctrl+Shift+T
will list terminal shells as shown below.