我读过其他几个论坛和帖子,内容是在打开一个新的集成终端会话时设置默认目录,但没有效果。
当我第一次开始使用VSC时,它似乎打开了最初几天的工作区目录。但它肯定是同步了我以前安装的设置,并带回了一些我在以前的windows安装中永远找不到的东西。由于某些原因,当打开终端时,它打开到Microsoft代码的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": "."
}我只更改了几个设置,比如选项卡位置和回滚值。
有什么想法吗?
发布于 2021-12-24 16:11:21
重新安装和更新版本的WSL似乎是唯一的解决办法。
https://stackoverflow.com/questions/67449939
复制相似问题