将当前工作目录(CWD)更改为VSCODE中的当前文件目录
因此,我正在尝试更改集成终端的目录,将我的Python脚本从根工作区(我猜默认值)运行到运行的文件目录。我想这样做,因为我习惯于与运行文件相比,而不是root dir。另外,有时我会使用很大的目录树,甚至是通往近目录文件的路径,从root dir启动它们就会变得很长。这也使我可以使用路径IntelliSense扩展名,因为它似乎是在当前文件DIR上的基础建议。 我听说过更改lauch.json文件,但我正在寻找一个确定的解决方案,该解决方案避免了在所有项目中都必须更改它。
我已经尝试将settings.json
cwd选项更改为“ terminal.integrated.cwd”:“ $ {filedirname}”
> ,即使在重新加载之后。
我不确定这里还有哪些其他Infos,但是我在Windows 11版本21H2上运行了VScode。任何其他信息都可以提出。
提前谢谢大家
So I'm trying to change the directory the integrated terminal runs my Python scripts in from the root workspace (the default, I guess) to the running file directory. I want to do this as I'm more used to work with paths relative to running file than to root dir. Also sometimes I use quite large directory trees and even paths to near directory files get quite long by starting them from root dir. This would also allow me to use Path Intellisense extension as it seems to base suggestions on the current file dir.
I heard about changing the lauch.json file but I'm looking for a definitive solution that avoids having to change this in all projects.
I have already tried to change settings.json
cwd option to "terminal.integrated.cwd": "${fileDirname}"
but it doesn´t seem to take any effect, even after reloading.
I'm not sure what other infos are relevant here, but nevertheless i'm running vscode on windows 11 version 21H2. Any other info feel free to ask.
Thank you all in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论