Skip to content

Instantly share code, notes, and snippets.

@branquito
Created April 25, 2013 16:48
Show Gist options
  • Save branquito/5461245 to your computer and use it in GitHub Desktop.
Save branquito/5461245 to your computer and use it in GitHub Desktop.
open git bash using `terminal` plugin for sublime
{
// The command to execute for the terminal, leave blank for the OS default
// On OS X the terminal can be set to iTerm.sh to execute iTerm
"terminal": "C:\\Windows\\System32\\cmd.exe",
// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["/c sh --login -i"]
}
@espellcaste
Copy link

It does not work! :(

@Zren
Copy link

Zren commented Apr 20, 2015

@espellcaste: This worked for me. It's prbably because sh.exe wasn't in the %PATH% variable.

{
    // The command to execute for the terminal, leave blank for the OS default
    // On OS X the terminal can be set to iTerm.sh to execute iTerm
    "terminal": "C:\\Program Files (x86)\\Git\\bin\\sh.exe",

    // A list of default parameters to pass to the terminal, this can be
    // overridden by passing the "parameters" key with a list value to the args
    // dict when calling the "open_terminal" or "open_terminal_project_folder"
    // commands
    "parameters": ["-c", "cd \"%CWD%\" && \"C:\\Program Files (x86)\\Git\\bin\\sh.exe\" -i -l"]
}

@Convicted202
Copy link

@zen, thanks a lot!

@kujiy
Copy link

kujiy commented Nov 13, 2015

Great guys, thanks a lot.
I updated this to use Git 2.5+ on Windows 8.1 64bit.

https://gist.github.com/kujiy/b1728a086e83cfa28807

@evrend
Copy link

evrend commented May 24, 2016

@Zren, Your settings still works.
Thanks a lot.

@kjdion84
Copy link

FYI on Windows I needed to use:
"terminal": "C:\\Program Files\\Git\\git-bash.exe",

@mourshied
Copy link

it works, thanks a lot.
on sublime text 3
preferences>package settings > terminal>settings-user
`{
// The command to execute for the terminal, leave blank for the OS default
// See https://github.com/wbond/sublime_terminal#examples for examples
"terminal": "C:\Program Files\Git\bin\sh.exe",

// A list of default parameters to pass to the terminal, this can be
// overridden by passing the "parameters" key with a list value to the args
// dict when calling the "open_terminal" or "open_terminal_project_folder"
// commands
"parameters": ["-c", "cd \"%CWD%\" && \"C:\\Program Files\\Git\\bin\\sh.exe\" -i -l"],

// An environment variables changeset. Default environment variables used for the
// terminal are inherited from sublime. Use this mapping to overwrite/unset. Use
// null value to indicate that the environment variable should be unset.
"env": {}

}
`

@csrajath
Copy link

thanks a lot, but isnt there no way where we can get this terminal to be embedded within the sublime editor instead of it opening a new git bash. What i mean is that just like VSCode as an in-built bash/git terminal which we can open by pressing ctrl+`
...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment