Relative Content

Tag Archive for visual-studio-codegit-bash

Git bash, cwd, and directory problems in VSCode

Somehow I broke my Git Bash integration on VSCode (windows). When I run a new terminal, the git bash prompt shows C:/Program Files/Microsoft VS Code instead of the correct working directory. If I cd .. it shows the correct working directory of /c/Users/myuser in the prompt and all seems okay from there with the prompt showing the correct path. Another weird thing is if I try cd ~ I get an error: bash: cd: $'C:\Usersmyuser': No such file or directory. So there’s something funky going on between the expectation of home being C:\home vs chome. I’ve tried setting the cwd in my .bashrc file, explored every option I could find in VSCode terminal settings, i.e. setting "terminal.integrated.cwd": "${workspaceFolder}" or anything else but no luck. Any suggestions?

Git Bash in VS Code starts in the wrong folder

My Git Bash terminal in VS Code started acting strange on Windows and I’m not sure what I did for it to be acting this way. It used to start in the workspace folder C:Users[User][path][to][Repo_folder] but now when I launch it, it starts in C:/Users/[User]/AppData/Local/Programs/Microsoft VS Code. I don’t have the issue with the other terminal like Powershell or cmd. I’ve also noticed the HOME variable is not set properly. It should be C:UsersEliotGodard but is set to C:UsersiotGodard. I’m not sure if it’s related or not. If I don’t reset the HOME var to the correct value, I can’t use the git command fatal: unable to access 'C:Users?liotGodard/.config/git/config': Invalid argument. The HOME var is set properly when using the Git Bash UI though /c/Users/EliotGodard. It seems like it could be related to the way Windows concatenates the path?