Copilot Agent 在终端本地运行命令 | AI生成和翻译

Home 2026.02

Question: 当在 VS Code 中使用 Copilot 的 agent mode 运行命令时,该命令是否实际上是在 VS Code terminal 中执行的?我们可以在嵌入式 terminal 中查看进度吗?

Answer:

是的,没错。

在 VS Code 的 GitHub Copilot agent mode 中(通过 Chat 视图或 Copilot Edits 视图选择 “Agent” 模式访问的本地交互式 agent),当 agent 需要执行 terminal 命令时(例如 npm installdotnet testcargo build、启动 dev server 等),它会在 VS Code 的 integrated terminal 中运行这些命令。

关于其工作原理的关键点:

这与独立的 GitHub-hosted Copilot coding agent 不同(后者通过 GitHub Actions 在云端运行,不使用你的本地 VS Code terminal)。

所以,是的 —— 当在 VS Code 中使用 agent mode 且 Copilot 建议或运行命令时,你可以(也应该)查看嵌入式 terminal 以关注正在发生的情况,查看实时输出,并在需要时进行干预。

References:


Back Donate