连接到远程 ssh 时如何启用 vs terminal git 命令自动完成?

How to enable vs terminal git command autocomplete when connected to remote ssh?

当连接到远程 ssh 时,我无法在 vs 代码集成终端上自动完成我的 git 命令。

当我在外部使用终端时自动完成工作。

有人可以帮我吗?

首先检查在远程服务器 rc 文件中激活 bahs 补全的位置。
检查您看到的位置(在远程服务器帐户目录上):

[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"

是否在:

  • ~remoteAccount/.bashrc
  • ~remoteAccount/.bashrc_profile
  • ~remoteAccount/.profile

microsoft/vscode-remote-release issue 83 似乎表明只有 .bashrc 是来源。

在您的情况下,一旦远程 SSH 会话在 VSCode 中打开,请尝试手动获取声明 bash_completion.sh 的文件。