0

I have Visual Studio Code for Windows and I was wondering if there is a way to make a shortcut to open git bash in VS Code in one click?

I tried looking through the setting but didn't seem to find anything useful.

starball
  • 20,030
  • 7
  • 43
  • 238
SIG4RT
  • 3
  • 2
  • Just to be clear, you want something that automates opening the terminal panel, selecting the Git Bash Profile, and creating a terminal with that profile into one single action? – starball Jul 08 '23 at 20:58
  • Did you mean Git Bash or Command line to apply git commands? Git Bash is an application. Why would you want a shortcut of that in VS code? – Md. Rakibul Islam Jul 08 '23 at 20:58
  • create a terminal profile for Git Bash and click the `+` icon in the terminal, or execute the command **Create Terminal with Profile** – rioV8 Jul 08 '23 at 21:08

1 Answers1

0

I don't know about a single click, but with keyboard shortcuts, you can do this:

{
    "key": "", // TODO: pick something
    "command": "workbench.action.terminal.newWithProfile",
    "args": {
        "profileName": "bash"
    }
}

Put that in your keybindings.json (use the Preferences: Open Keyboard Shortcuts (JSON) command in the command palette. This requires that you have already opened VS Code. If you're looking for something like a dock shortcut, then that's a different thing (that I don't know how to do).

Side note: If you actually want to open the VS Code integrated terminal in its own window, see this answer post of mine.

starball
  • 20,030
  • 7
  • 43
  • 238