zsh (cygwin) 终端的默认目录是 home,而不是 Windows 上 VSCode 的工作目录

发布于 2025-01-14 19:20:34 字数 578 浏览 3 评论 0原文

我在 VSCode 中通过 Cygwin 设置了 zsh 的自定义配置文件,如下所示:

"terminal.integrated.profiles.windows": {
    "zsh": {
        "path": "C:\\cygwin64\\bin\\bash.exe",
        "args": ["--login", "-c", "zsh"],
        "overrideName": true,
        "color": "terminal.ansiRed"
    }
},
"terminal.integrated.defaultProfile.windows": "zsh",

但默认目录是 /home/ADMIN,而不是我的工作目录(我正在工作的源代码的 repo 目录)。有谁知道如何解决这个问题?先感谢您。

输入图片此处描述

I have setup custom profile for zsh via Cygwin in VSCode as below:

"terminal.integrated.profiles.windows": {
    "zsh": {
        "path": "C:\\cygwin64\\bin\\bash.exe",
        "args": ["--login", "-c", "zsh"],
        "overrideName": true,
        "color": "terminal.ansiRed"
    }
},
"terminal.integrated.defaultProfile.windows": "zsh",

But the default directory is /home/ADMIN, not my working directory (repo directory of source code I'm working). Does anyone know how to solve this problem? Thank you in advance.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾`听者〃 2025-01-21 19:20:34

尝试

"terminal.integrated.env.windows": {
    "CHERE_INVOKING": "1"
},

Try

"terminal.integrated.env.windows": {
    "CHERE_INVOKING": "1"
},
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文