[BUG] VS Code 在打开集成终端(PowerShell 7)时弹出“扩展希望重启终端以为其环境做出贡献”提示(可用但有提示)

Resolved 💬 4 comments Opened Nov 7, 2025 by matriox1003 Closed Jan 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

描述: 在 Windows 11 上使用 Claude Code for VS Code 时,每次打开集成终端(PowerShell 7 / pwsh)都会出现“以下扩展希望重启终端以为其环境做出贡献”的提示,显示为: “以下扩展希望重启终端以为其环境做出贡献: Claude Code for VS Code Shell 集成: 丰富” 终端本身可以正常使用,功能不受影响,但提示会频繁弹出,影响体验。

环境(environment):

操作系统:Windows 11 25H2
VS Code 版本:1.105.1
插件版本:Claude Code for VS Code 2.0.35
PowerShell 版本:7.5.4
发生时的进程 ID (PID):16560
VS Code 启动终端使用的命令行:
…\pwsh.exe -noexit -command 'try { . "d:\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1" } catch {}'
settings.json 中与终端相关的片段(相关 profile 未显式包含 pwsh):
"terminal.integrated.profiles.windows": {
"Command Prompt": { "path": ["env:windir\Sysnative\cmd.exe",
"{env:windir}\System32\cmd.exe"], "args": [], "icon": "terminal-cmd" },
"Git Bash": { "source": "Git Bash" },
"Windows PowerShell": { "path": "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" }
}
<img width="652" height="382" alt="Image" src="https://github.com/user-attachments/assets/6c532f01-4f75-4cfe-8e58-87d69df10413" />

实际行为(actual behaviour): 每次打开集成终端时出现上述提示。终端本身可以使用,但提示会不断打扰用户。

What Should Happen?

若扩展在后台对终端环境做出贡献,应尽量避免频繁弹出“重启终端”提示。

Error Messages/Logs

进程 ID (PID): 16560

命令行: …\pwsh.exe -noexit -command 'try { . "d:\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1" } catch {}'

 以下扩展希望重启终端以为其环境做出贡献:

Claude Code for VS Code
Shell 集成: 丰富

Steps to Reproduce

  1. 在 Windows 11 上安装并打开 VS Code(1.105.1)。
  2. 安装并启用 Claude Code for VS Code(2.0.35)。
  3. 打开 VS Code 并打开集成终端(Terminal, 确保Powershell 7 为默认终端)。
  4. 观察到弹出提示“以下扩展希望重启终端以为其环境做出贡献”,但终端仍可正常使用。

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.35 (Claude Code)

Platform

Other

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

<img width="652" height="382" alt="Image" src="https://github.com/user-attachments/assets/9fa6c323-707f-47bb-b791-db1a2b3aaa9a" />

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗