-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Description
🐞 Bug Report: PowerShell 7 Crashes in Integrated Terminal with Exit Code -1073741571 When fnm Is Active
VS Code Version: 1.102.0
PowerShell Version: 7.5.2
Node Manager: fnm
OS: Windows 10/11
Shell: PowerShell 7 (pwsh.exe)
Error Message:
The terminal process "C:\Program Files\PowerShell\7\pwsh.exe" terminated with exit code: -1073741571
💥 Issue Summary
When launching PowerShell 7 in VS Code’s integrated terminal, the shell crashes with exit code -1073741571 (stack overflow). This only occurs when fnm is installed and active. PowerShell 7 works fine outside VS Code, and other shells work inside VS Code.
🔍 Steps to Reproduce
- Install fnm and activate a Node version.
- Launch VS Code.
- Open integrated terminal with PowerShell 7 as default.
- Observe crash with exit code -1073741571.
✅ What I’ve Tried
- Launching with -NoProfile
- Disabling all extensions (
code --disable-extensions) - Running VS Code as Admin
- Creating a clean wrapper script for PowerShell
- Comparing $env:PATH across environments
Does this issue occur when all extensions are disabled?: Yes
📎 Environment Clues
- fnm injects multiple fnm_multishells/... entries into $env:PATH
- Removing those entries resolves the crash
- Crash only occurs inside VS Code’s integrated terminal
📌 Suspected Cause
VS Code’s terminal renderer may be sensitive to deep or malformed environment chains introduced by fnm. This appears to trigger a stack overflow during shell startup.
🙏 Request
Can you investigate whether VS Code’s terminal subsystem can be made more resilient to injected PATH variables like those from fnm? Or suggest ways to isolate shell profiles more safely?