Skip to content

VS Code Terminal Stack Overflow (-1073741571) Triggered by fnm PATH Injection #255699

@stevenried

Description

@stevenried

🐞 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

  1. Install fnm and activate a Node version.
  2. Launch VS Code.
  3. Open integrated terminal with PowerShell 7 as default.
  4. 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?

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugterminal-shell-integrationShell integration infrastructure, command decorations, etc.terminal-shell-pwshAn issue in the terminal specific to PowerShell, including shell integrationverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions