Amb*_*jak 14 visual-studio-code
我可以启动 VS Code 以使用code /path/to/folder. 是否可以通过在命令行上指定计算机和文件夹来打开远程计算机上的文件夹(通过远程 SSH 扩展)?
Gui*_*ent 17
从 Linux 或 Mac 终端上的 cli:
code --folder-uri=vscode-remote://ssh-remote+<HOSTNAME><ABSOLUTE_PATH>
就像是:
code --folder-uri=vscode-remote://ssh-remote+centos8stream.local/home/guillaume/workspace/
在我的~/.ssh/config文件中我有:
Host centos8stream.local
Hostname 10.41.11.69
User guillaume
Run Code Online (Sandbox Code Playgroud)
在我的终端中,我可以 ssh 到我的服务器ssh centos8stream.local
然后我可以直接在远程服务器上打开vscode:
code --folder-uri=vscode-remote://ssh-remote+centos8stream.local/home/guillaume/workspace/
~/.zshrc我什至在我的文件中创建了一个别名函数
function rcode() { code --folder-uri=vscode-remote://ssh-remote+$1/home/guillaume/$2 }
Run Code Online (Sandbox Code Playgroud)
然后我只需输入
rcode centos8stream.local workspace/my_project
| 归档时间: |
|
| 查看次数: |
6558 次 |
| 最近记录: |