在 vscode 的 Devcontainer 中,有没有一种方法打开 ssh 终端?

huangapple go评论58阅读模式
英文:

Is there a way to open ssh terminal when we are inside Devcontainer in vscode?

问题

我正在连接到安装了Docker的SSH机器。从SSH机器上,我将使用Devcontainer。我大部分时间都在使用Devcontainer。有时候,我需要在SSH终端中运行命令。在这个时候,我会执行'在SSH中重新打开文件夹'并在终端中运行命令。

有没有办法可以同时在SSH中打开一个终端和一个Devcontainer终端?

英文:

I am connecting to ssh machine in which I have installed Docker.
From the ssh machine I will use Devcontainer.
I am using Devcontainer most of the time. Some time I need to run commands from terminal in ssh. During that time i am doing 'Reopen folder in ssh' and run commands in terminal.

Is there a way that I can open one terminal in SSH and one in Devcontainer at the same time?

答案1

得分: 0

从命令面板 -> 首选项: 打开远程设置 (JSON) (Dev Container) 在 devcontainer 中。我需要添加以下内容:

{
    "terminal.integrated.profiles.linux": {
        "bash (Host)": {
            "path": "ssh",
            "icon": "home",
            "args": [
                "user@host",
            ],
        },
    },
}
英文:

https://stackoverflow.com/questions/71145541/how-to-open-local-terminal-when-running-vscode-in-a-dev-container

The above post has an answer for this situation.

From command pallete -> Preferences: Open Remote Settings (JSON) (Dev Container) in devcontainer .
I need to add this

{
    "terminal.integrated.profiles.linux": {
        "bash (Host)": {
            "path": "ssh",
            "icon": "home",
            "args": [
                "user@host",
            ],
        },
    },
}

huangapple
  • 本文由 发表于 2023年5月13日 11:06:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/76240906.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定