19

Since last VSCode version there was a popup asking me if I want to allow Git to open. Well I allowed this and now every time I try to open the integrated terminal the Git Shell opens externally and closes the integrated terminal.

My user config:

"terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"

But it doesn't help because git is already running.

I want to open powershell instead and have git shell inside of VSCode as it was before. How can I achieve this?

UPDATE:

I run git config -l --show-origin as VonC suggested:

file:"C:\\ProgramData/Git/config"       core.symlinks=false
file:"C:\\ProgramData/Git/config"       core.autocrlf=true
file:"C:\\ProgramData/Git/config"       core.fscache=true
file:"C:\\ProgramData/Git/config"       color.diff=auto
file:"C:\\ProgramData/Git/config"       color.status=auto
file:"C:\\ProgramData/Git/config"       color.branch=auto
file:"C:\\ProgramData/Git/config"       color.interactive=true
file:"C:\\ProgramData/Git/config"       help.format=html
file:"C:\\ProgramData/Git/config"       http.sslcainfo=D:/TOOLS/Git/mingw64/ssl/certs/ca-bundle.crt
file:"C:\\ProgramData/Git/config"       diff.astextplain.textconv=astextplain
file:"C:\\ProgramData/Git/config"       rebase.autosquash=true
file:"D:\\TOOLS\\Git\\mingw64/etc/gitconfig"    credential.helper=manager
file:C:/Users/myusername/.gitconfig  filter.lfs.clean=git-lfs clean -- %f
file:C:/Users/myusername/.gitconfig  filter.lfs.smudge=git-lfs smudge -- %f
file:C:/Users/myusername/.gitconfig  filter.lfs.process=git-lfs filter-process
file:C:/Users/myusername/.gitconfig  filter.lfs.required=true
file:C:/Users/myusername/.gitconfig  user.name=MYName
file:C:/Users/myusername/.gitconfig  user.email=some@email.com
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=false
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        core.symlinks=false
file:.git/config        core.ignorecase=true
file:.git/config        remote.origin.url=https://github.com/MyProject/my-project.git
file:.git/config        remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config        branch.master.remote=origin
file:.git/config        branch.master.merge=refs/heads/master
file:.git/config        branch.routing.remote=origin
file:.git/config        branch.routing.merge=refs/heads/routing

My VScode user settings:

"php.validate.executablePath": "D:/TOOLS/xampp7/php/php.exe",
"php.suggest.basic": false,
"window.zoomLevel": 0,
"workbench.colorTheme": "Monokai",
"workbench.iconTheme": "vs-seti",
"git.path": "D:/TOOLS/Git/cmd/git.exe",
// A glob pattern that defines files and folders to exclude while listing annotations
  "todohighlight.exclude": "{**/node_modules/**,**/bower_components/**,**/bower/**,**/libs/**,**/vendor/**,**/dist/**,**/build/**,**/.vscode/**,**/_output/**,**/*.min.*,**/*.map}",
  "git.autofetch": true,
  "git.confirmSync": false,
  "git.enableSmartCommit": true,
  "explorer.confirmDelete": false,
  "terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
  "todo.colors.tag": "#967848",
  "todo.colors.code": "#fbf5cb",

Default settings with the git keyword:

  "projectManager.git.baseFolders": [],
  "projectManager.git.maxDepthRecursion": 4,
  "git.autofetch": false,
  "git.autorefresh": true,
  "git.checkoutType": "all",
  "git.confirmSync": true,
  "git.countBadge": "all",
  "git.decorations.enabled": true,
  "git.defaultCloneDirectory": null,
  "git.enableCommitSigning": false,
  "git.enabled": true,
  "git.enableSmartCommit": false,
  "git.ignoreLegacyWarning": false,
  "git.ignoreLimitWarning": false,
  "git.ignoreMissingGitWarning": false,
  "git.path": null,
oɔɯǝɹ
  • 7,219
  • 7
  • 58
  • 69
Hexodus
  • 12,361
  • 6
  • 53
  • 72
  • https://code.visualstudio.com/docs/editor/integrated-terminal – trebleCode Jan 24 '18 at 19:08
  • @trebleCode Sorry but I know this doc - it's not helping me with my specific problem. If I call the integrated terminal git pops up externally and closes the integrated terminal so I have no chance to change there something. If I exit git it still automatically opens when I open the vcode terminal ;( – Hexodus Jan 24 '18 at 19:22
  • Oh ok, sorry I misunderstood.Have you tried backing up your user and workspace settings, and trying to start from a "fresh" boot up of VSCode? – trebleCode Jan 24 '18 at 19:38
  • @trebleCode Yes I just did that but same behavior ;( I think that this is more a git thing... – Hexodus Jan 26 '18 at 12:21
  • Can you check the user and workspace setting and see anything that got customized when you allowed git to open? – Tarun Lalwani Feb 07 '18 at 05:17
  • @TarunLalwani Good idea - I just added the settings to my post. – Hexodus Feb 07 '18 at 19:17
  • Try removing all the git.* and see if it helps. If not then try getting rid of `"terminal.integrated.shell.windows"` and see if anything changes. You want to just backup these settings before playing around – Tarun Lalwani Feb 07 '18 at 19:26

3 Answers3

3

I think that this is more a git thing

Then uninstall Git for Windows if you did use the setup.
For that, first, check (and move/delete) the various Git config files listed with:

git config -l --show-origin

If this is from a Git setting, you could see it there.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks but uninstalling git seems to be a gross step for just getting rid of the described behavior. I thought that it's a minor issue and which can be simpler fixed. I do not understand how the list of origins might help me. – Hexodus Jan 30 '18 at 18:30
  • @Hexodus at least, check `git config -l --show-origin`: there might be a setting in there that explains what you see. – VonC Jan 30 '18 at 20:21
  • I did as suggested and updated my post with this information. So far I don't see something helpful - do you? – Hexodus Jan 31 '18 at 18:16
3

I figured out what's causing this problem or at least a part of it. In an another project I could perfectly open the terminal so I compared these two projects and found out that the one with the problem has a .vscode folder with this settings.json inside:

{
    "terminal.integrated.shell.windows": "D:\\TOOLS\\Git\\git-bash.exe",
    "terminal.integrated.shell.windows": "C:\\WINDOWS\\Sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
}

Well this has been obviously created by VSCode itself and has nothing to do with the user config file that shows up using the GUI. Then I just commented out the git-bash line and started VSCode. Since then I got rid of git auto starting in the terminal. The annoying thing now is that I have to login to Github every time I load the project. Uncommenting the line didn't change that behavior.

If someone can explain better what's happening there and how to restore the github autologin (without occupying my terminal) I will sill accept a good answer.

Hexodus
  • 12,361
  • 6
  • 53
  • 72
1

Download and install git from https://git-scm.com/download/win

The default path for git should be C:\\Program Files\\Git\\bin\\bash.exe

Then go to File > Preferences > Settings and add this code under your other settings:

{
[...]
"git.enabled": false,
"git.path": null,
"git.autofetch": false,
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"
}

Hope this helps!