如何在IntelliJ终端中开启GitHub Copilot自动补全功能?
开启IntelliJ终端的GitHub Copilot Shell补全方法
- 检查Copilot插件版本:确保同事安装的GitHub Copilot为最新版本,旧版本可能未适配终端补全功能。
- 确认终端shell兼容性:Copilot Shell补全仅支持
bash(4.4+)、zsh(5.8+)、fish(3.3+),需确认同事IntelliJ终端使用的shell在支持范围内。 - 开启终端补全配置:
- 打开IntelliJ设置(快捷键
Ctrl+Alt+S或Cmd+,) - 导航至Tools > Terminal > GitHub Copilot
- 勾选Enable GitHub Copilot for terminal,同时确保对应shell的启用选项已勾选
- 打开IntelliJ设置(快捷键
- 重启IntelliJ:修改配置后重启IDE,使设置生效。
- 手动初始化补全脚本(若上述步骤无效):
在IntelliJ终端执行对应shell的初始化命令:- bash:
source <(github-copilot-cli alias -- bash) - zsh:
source <(github-copilot-cli alias -- zsh) - fish:
github-copilot-cli alias -- fish | source
- bash:
内容的提问来源于stack exchange,提问作者JGleason
相关产品推荐
相关产品推荐

