VS 代码 ssh;服务器安装路径

Vol*_*nox 4 ssh installation visual-studio-code

我正在尝试更改 VS Code 服务器文件夹安装位置。该功能最近已实现,我找到了以下参考文献[1][2]。但是,我自己无法实现它,并且在尝试时收到以下错误消息:

C:\\Users\\username/.ssh/config: line 1: Bad configuration option: remote.ssh.serverinstallpath 
C:\\Users\\username/.ssh/config: terminating, 1 bad configuration options
Run Code Online (Sandbox Code Playgroud)

配置文件的构建方式如下

"remote.SSH.serverInstallPath": {"hostname": "/test/location"}

Host hostname
  HostName hostname
  User username
Run Code Online (Sandbox Code Playgroud)

注意:我已将连接隐藏为“主机名”,将用户隐藏为“用户名”

shr*_*nsp 9

此配置适用于 vscode 的settings.json文件(不是.ssh/config):

例如,在 Windows 上,执行Ctrl+ Shift+ P>“首选项:打开用户设置 (JSON)”。然后,您可以在末尾添加以下行。

"remote.SSH.serverInstallPath": {
    "<host>": "/test/location"
}
Run Code Online (Sandbox Code Playgroud)

或者,如果您想通过设置 UI 进行操作:

  1. 文件 > 首选项 > 设置
  2. 筛选:@ext:ms-vscode-remote.remote-ssh install
  3. 在“服务器安装路径”下 > 添加项目
    • 项目 =<host>
    • 值=/test/location