admin管理员组

文章数量:1125554

When I open a GitBash terminal in VSCode while I have a virtual environment activated, the path displayed on top of the input line is C:/Users/username/AppData/Local/Programs/Microsoft VS Code, but the current working directory is the root of the current project (which is what I want), as proved by running pwd or ls, or cd'ing into a subfolder.

Cd'ing into a subfolder and then back into the parent, or running exec bash fixes the problem, until I open the project again. Also, the problem only happens with GitBash, while powershell works fine.

I have tried inspecting activate.ps1 and activate.bat in my venv/Scripts folder and the .bashrc file, but there is no line like export PS1="(venv) $PS1", nor any reference to the VSCode installation folder. I have also tried changing "terminal.integrated.cwd" to "${workspaceFolder}" in VSCode's settings.json, but to no avail. I suppose it's a bug in how GitBash initializes or updates the displayed path, but I can't for the life of me figure out what it is precisely.

Thanks in advance.

本文标签: