Visual Studio代码WSL远程-WSL终端忽略Cwd



我读过其他几个论坛和帖子,关于在打开新的集成终端会话时设置默认目录,但都没有用。

当我第一次开始使用VSC时,它似乎在最初几天打开了工作区目录。但它一定同步了我以前安装的设置,并带回了我以前在windows安装时永远无法弄清楚的东西。由于某种原因,当它打开一个终端时,它会打开Microsoft VS Code的AppData文件夹位置,如下所示:

<user>@<hostname>:/mnt/c/Users/<user>/AppData/Local/Programs/Microsoft VS Code$

例如,如果我进入文件>首选项>设置并尝试添加$HOME或${HOME}我得到:

The terminal process failed to launch: STarting directory (cwd) 
"/home/<user>/${HOME}" does not exist.

The terminal process failed to launch: Starting directory (cwd) 
"/home/<user>/$HOME" does not exist.

在这样做之后,如果我删除了Cwd中的信息,那么我会收到错误:

Setting has an invalid type, expect "string". Fix in JSON.

我可以通过将设置更改为:来解决此问题

"terminal.integrated.cwd": "."

我的用户配置文件基本上是默认的:

{
"workbench.editorAssociations": [
{
"viewType": "jupyter.notebook.ipynb",
"filenamePattern": "*.ipynb"
}
],
"git.autofetch": true,
"workbench.colorTheme": "One Dark Pro",
"python.languageServer": "Pylance",
"terminal.integrated.scrollback": 10000,
"terminal.integrated.tabs.enabled": true,
"terminal.integrated.tabs.location": "left",
"terminal.integrated.bellDuration": 10000,
"terminal.integrated.cwd": "."
}

我只更改了一些设置,比如标签位置和滚动值。

有什么想法吗?

重新安装和更新版本的WSL似乎是唯一的解决方案。

最新更新