PigRider Blogs

Sign In
HTML CSS Javascript Ruby on Rails C++ Java Python SQL Git Linux Others All

Open Git Bash Terminal From Sublime Text

[Author: Dingyu]   [Thu, 2017-06-15, 12:06]   [1629 views]

Others

1. Install Sublime Package Control plugin from the website: https://packagecontrol.io/

2. Use Package Control to install Sublime Terminal plugin. (http://wbond.net/sublime_packages/terminal)

3. Change the setting of Sublime Terminal as:
{
    // 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\\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"]
}
4. Done! 5. Update on 6/15/2017. I found this setting also works for Git (version 2.13.1.windows.1):
{
    // 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\\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": ["--cd=%CWD%"]
}
It's easier to understand. Also, using Git\bin\sh.exe instead of Git\git-bash.exe in Windows could avoid yarn init error: "Can't answer a question unless a user TTY".