Git Bash opens several times before using in VSC - visual-studio-code

I've tried integrating Git Bash in VSC as an internal default terminal, but whenever I run VSC or open a terminal section a few standalone windows of Git Bash open and close immedietely. After that Git Bash works properly in integrated window. I want to avoid these pop-ups, but cannot solve the problem.
Standalone windows (https://i.stack.imgur.com/UY3E4.png)
My .json file is:
{
"terminal.integrated.defaultProfile.windows": "Git Bash"
}
I've tried using various json commands, such as
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
I also reainstalled both git and vsc. I haven't encountered this issue on my other PC.

Related

VSCode opens different workspace from commandline and gnome launch icon on Fedora

I have VSCode 1.65.2 running on Fedora 35, and I always launch it from Gnome (by clicking on the VSCode icon). I recently wanted to set up VSCode as the editor for git by running git config --global core.editor "code -r --wait", so that if I would run e.g. git commit in VSCode's integrated terminal, it would open the commit message in the already open VSCode window. But the result is that it always opened a new window, even though I passed -r to it.
I found out that VSCode launched from the command line used settings from the ~/Code folder, while if I launched it from Gnome (by clicking on the icon), it used ~/.config/Code for my settings.
So I created a symlink from ~/Code to ~/.config/Code, and I hoped that it would solve this issue.
It did not.
It still always behaves differently if I launch it from Gnome and if I launch it from the command line.
How can I solve this?

Redefine Terminal does not work when starting VS Code

I can live with it, but...
I have changed the terminal from PowerShell to git bash in the settings:
"terminal.integrated.defaultProfile.windows": "Git Bash"
This does its job. When I create a new terminal, it is git bash by default.
However, when I start Visual Studio Code, it opens with a PowerShell terminal. (All new terminals are git bash terminals.)
To set the default terminal in VS Codem , you should follow this steps:
Open VS Code
Press CTRL+Shift+P / ⇧⌘P and search for terminal select default shell
Make your selection and press enter (In my case I chose Git Bash)
All of your new terminals will now default to your choice 🎉
I hoped this helped you.

How to integrate git bash in visual studio code

How to integrate git bash in visual studio code? I typed " open user setting " then I am getting this window:
VSCode has support for git built in.
You might need to check that the directory containing the git executable is on your PATH environment variable. Alternatively, in settings.json, set git.path, for example:
{
"git.path": "d:/opt/git-for-windows-2.23.0/bin/git.exe"
}
You also need to install git first.
Following steps have to be followed to integrate Git Bash with Visual Studio Code:
Step-1
You have to open settings by File->Preferences->Settings or by pressing Ctrl+, AND click on the Open Settings(JSON) icon on the top right corner of vs code editor
Step-2
On clicking, you will see the settings page. You have to copy:
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
and paste at the last of all settings. Make sure that you have installed git bash on your computer.
Step-3
And that’s all when you will reopen VS Code then you will see that Git Bash has been integrated. Now you can run Git Bash commands directly in VS Code.

Git Bash terminal in Eclipse on MS Windows

I have two different laptops running MS Windows and noticed on one laptop there was a Git Bash option for a new terminal window in the Terminal view in Eclipse, while it was not available on the other laptop.
After a little trial and error, I was able to determine the Git Bash option is only available if the git cli client from https://git-scm.com is installed.
I like to be able to run git from the command line in Eclipse without having to switch windows. Hope this helps someone trying to do the same thing.
You can use the Open A Terminal icon to open up Git Bash if Git Bash is already installed on your Windows machine.
Update:
Add Gitbash terminal to Eclipse:
Install this plugin on Eclipse Marketplace:
TM Terminal
https://marketplace.eclipse.org/content/tm-terminal
After that, go to Window -> Preferences -> Terminal -> Local Terminal and add a entry with full path where Git Bash executable (bash.exe) was installed.
Then you can open Git Bash pressing CTRL+ALT+SHIFT+T.

Unable to run npm, node from bash in VSCode

I have setup my integrated terminal to be bash as shown below:
{
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
}
Bash is working but when I try to run things like npm, node, ect it says the command is not found. If I run the standalone git bash.exe (not the one in the bin folder) it works correctly but you have to run the one in the bin folder to have it integrated, what do I need to do to fix it?
Add "terminal.integrated.shellArgs.windows": ["--login","-i"] to your settings. You may have noticed git bash.exe runs with these arguments.
I had a similar issue (missing arguments) when setting up an integrated terminal with Visual Studio - although I haven't had a problem with VSCode.