visual-studio-code - 如何从 VScode 中的远程 session 打开本地终端?

标签 visual-studio-code vscode-settings vscode-remote

当我在 VScode 中打开我的工作区时,我会直接进入我的 SSH 工作区,这正是我想要的。但是我想要一个可以访问我的 SSH 工作区和本地计算机终端的拆分终端,但是如果不从下拉窗口中创建一个明确的新终端,我就无法访问本地终端。如果我尝试拆分新的本地终端,我会收到错误消息“终端外壳 CWD“/Users/asd/work/”不存在”,就好像它正在我的 SSH 工作目录中查找一样。有没有办法指定默认终端在我的本地计算机上?如果我在 VScode 的终端首选项中这样做,我会在启动时收到 CWD 错误。

最佳答案

这应该已经通过 microsoft/vscode-remote-release issue 1479 解决了

Both of you don't have C:\Windows\System32 on your path, I don't understand why that is.

But I will change this to not rely on the PATH.

即使这最初是针对 Windows 的,现在也应该可以在进行远程 session 时打开本地 shell(Mac 或 Windows)。

使用 ctrl+shift+pcmd+shift+< kbd>p(命令面板),你有:

Terminal: Create New Integrated Terminal (local)

奖金,VSCode 1.53(2021 年 1 月),现在有:

Remote layout persistence

终端布局在远程终端重新连接时恢复。在下面的视频中,终端布局在重新加载 VS 代码并重新连接到适用于 Linux 的 Windows 子系统 (WSL) 远程实例时恢复。

In a remote window, three split terminals are created and resized. On reload, the layout appears unchanged. -- https://media.githubusercontent.com/media/microsoft/vscode-docs/vnext/release-notes/images/1_53/terminal-splits-persist.gif

关于visual-studio-code - 如何从 VScode 中的远程 session 打开本地终端?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58303195/

相关文章:

c# - 无法在 VS Code 终端中创建 C# 控制台应用程序

python - Visual Studio,OpenCV,Python-应用中无网络摄像头

visual-studio-code - 如何在 VSCode 中触发 "inline suggestion"?

git - 在远程 VSCode session 上签署 Git 提交

text - 如何在 VSCode 2018 中移动 block ?那可能吗?

php - Visual Studio Code : Spawn UNKNOWN

powershell - 如何使用 VSCode 中的 -OutPut 详细信息快速运行 Pester?

visual-studio-code - 如何使用扩展包更新 vscode 中的用户 settings.json?

git - 由于默认设置,从 VSCode Remote-Container 到 AWS CodeCommit 存储库的连接失败

docker - VSCode Remote Container -- 如何打开 VSCode 容器实例中的默认文件夹?