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.
本文标签:
版权声明:本文标题:visual studio code - VSCode integrated terminal displays the wrong path but opens in the correct directory in projects with a vi 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736632217a1945803.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论