Visual Studio Code WSL Remote - WSL 终端忽略 Cwd

问题描述

我已经阅读了其他几个关于在打开新的集成终端会话时设置认目录无济于事的论坛和帖子。

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

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

例如,如果我进入 File > Preferences > Settings 并尝试添加 $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": "."
}

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

有什么想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)