6

I use Sublime Text 3 as my default text/code editor and I very frequently use the terminal in Sublime Text 3 with the Terminus package. And recently I've discovered git it has a really wonderful bash and I prefer using the git bash instead of using git through the default Windows terminal.

Is there any way that I can do it?

3 Answers 3

13

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).

Sign up to request clarification or add additional context in comments.

Comments

6

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"] }, ] } 

2 Comments

Interesting; the example I posted works on all of my Windows boxes just fine.
@OdatNurd solution also doesn't work for me on Windows 7.
3

setup git bash/cmd terminal in sublime text editor

GOTO preferences> package settings> terminus> settings

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

Then GOTO preferences> package settings> terminus> key bindings>

[ { //alt+1 for cmd "keys": ["alt+1"], "command": "terminus_open", "args" : { "cmd": "cmd.exe", "cwd": "${file_path:${folder}}", "panel_name": "Terminus" } }, { //alt +2 for git bash "keys": ["alt+2"], "command": "terminus_open", "args" : { "cmd": ["C:/Program Files/Git/bin/sh.exe"], "cwd": "${file_path:${folder}}", "panel_name": "Terminus" } }, ] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.