How to use git bash in sublime text 3 How to use git bash in sublime text 3 bash bash

How to use git bash in sublime text 3


To do this, open the Terminus preferences by choosing Preferences > Package Settings > Terminus > Settings from the menu or Preferences: Terminus Settings from the command palette.

Both will open the Terminus settings in a new split window, with your settings on the right and the defaults on the left. What you need to do is add a shell_configs key to your preferences (the right pane) that includes a new configuration for using Git Bash.

That would look something like this:

    "shell_configs":    [        {            "name": "Git Bash",            "cmd": ["cmd.exe", "/k", "C:/Program Files (x86)/Git/bin/bash.exe"],            "env": {},            "enable": true,            "default": false,            "platforms": ["windows"]        },    ]

Replace the path to Git Bash as appropriate if it's not installed in the default location. You can also set default to true instead of false if you want to use it by default.

If you add this setting to your preferences as it appears here, then the only shell configuration that will exist will be this one. If you want to still be able to use the other configurations as well, then copy the default value of the setting from the Left pane to the right, and then add yours to the list (remember that all of the settings need to be comma separated).


OdatNurd, thank you for the idea, but cmd.exe opening git bash in separate window. I used your idea and change following settings as bellow to start git bash shell in Terminus Panel, which is appearing in Sublime text. It works for me.

{    "shell_configs":    [        {            "name": "Git Bash",            "cmd": ["C:/Program Files/Git/bin/sh.exe"],            "env": {},            "enable": true,            "default": false,            "platforms": ["windows"]        },    ]}