PowerShell Integrated Terminal Crashes when Changing Folders
Type: Bug
Steps to reproduce:
- Ensure you have have opened two separate Git repositories both with the integrated PowerShell terminal loaded first! This is required so that PowerShell attempts to automatically open each time you open a new Git folder.
- Open Visual Studio Code.
- Open a folder with a Git repository.
- PowerShell integrated terminal will stay open.
- Open another folder with Git repository.
- PowerShell integrated terminal crashes with the error: "The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" terminated with exit code: -1073741510."
Have tried:
- Disabling all Visual Studio Code extensions.
- Removing all Visual Studio Code "@modified" settings.
- Deleting the "C:\Users<UserName>\AppData\Roaming\Code' folder.
Notes:
- Downgrading to Visual Studio Code 1.97.2 on Windows 11 24H2 seems to work.
- Visual Studio Code 1.98.0 does not have the same issue when on Windows 11 23H2.
Issue occurs when:
- Using Windows 11 24H2 and Visual Studio Code 1.98.0
Isse does not occur when:
- Using Windows 11 24H2 and Visual Studio Code 1.97.2
- Using Windows 11 23H2 and Visual Studio Code 1.98.0
VS Code version: Code 1.98.0 (6609ac3d66f4eade5cf376d1cb76f13985724bcb, 2025-03-04T21:06:18.612Z) OS version: Windows_NT x64 10.0.26100 Modes:
System Info
| Item | Value |
|---|---|
| CPUs | 13th Gen Intel(R) Core(TM) i9-13900K (32 x 2995) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 63.72GB (52.90GB free) |
| Process Argv | --crash-reporter-id 5dc200e8-363d-4d5f-8dc6-63a69f76ed42 |
| Screen Reader | no |
| VM | 0% |
Extensions (4)
| Extension | Author (truncated) | Version |
|---|---|---|
| debugpy | ms- | 2025.4.0 |
| python | ms- | 2025.2.0 |
| vscode-pylance | ms- | 2025.3.1 |
| powershell | ms- | 2025.0.0 |
I also encountered this problem,
My system information
版本: 1.98.0 (user setup) 提交: 6609ac3d66f4eade5cf376d1cb76f13985724bcb 日期: 2025-03-04T21:06:18.612Z Electron: 34.2.0 ElectronBuildId: 11044223 Chromium: 132.0.6834.196 Node.js: 20.18.2 V8: 13.2.152.36-electron.0 OS: Windows_NT x64 10.0.26100
This extension issue might also be related: https://github.com/nguyenngoclongdev/vs-terminal-keeper/issues/52
I also encountered the same problem. When I opened a project, the terminal would crash when it was automatically started. When I closed all terminals and opened a pwsh, it would also crash. However, it would not crash if I opened it again after a few seconds.
Experiencing this problem as well, Windows 11 24H2, VS Code 1.98.0
Does this occur if you use Powershell vs windows powershell? The latter has performance issues and we suggest using the former.
@meganrogge I use powershell 7.5.0 installed from github release executable (reinstalled, before it was winget installation, nothing changed for me, the issue persists)
does changing terminal.integrated.windowsUseConptyDll fix it?
@meganrogge with some brief testing, it seems that the dll option does fix it.
@meganrogge, I am confirming that changing terminal.integrated.windowsUseConptyDll resolves the terminal crashing when changing folders.
Regarding Windows PowerShell/PowerShell versions, I only have Windows PowerShell 5.1 installed. The terminal.integrated.windowsUseConptyDll fix works with Windows PowerShell 5.1.
Can users check if the issue is fixed in latest insiders https://code.visualstudio.com/insiders with "terminal.integrated.windowsUseConptyDll": false setting ?
If it works, the fix will be backported as candidate to 1.98.2 release. Thanks!
Do you need us to manually add that setting? Or are you saying its already set to 'false'? I'm testing it right now, and seems fixed (didn't try to set that setting).
@unsivilaudio please add that setting, the default with insiders is true
@deepak1556 , the issue does NOT occur with "terminal.integrated.windowsUseConptyDll": false or "terminal.integrated.windowsUseConptyDll": true on Visual Studio Code Insiders.
Is there anything else you need tested?
Thanks for testing, this is good enough to confirm the fix. Closing for release verification from our side.
Steps for verification:
- Ensure the setting
"terminal.integrated.windowsUseConptyDll": false - Open a powershell terminal
- Kill the terminal with the trash icon
- Attempt to open a new terminal immediately
- With
1.98.0it should fail with the error"The terminal process ... terminated with exit code: -1073741510." - With sanity build the issue should be fixed
Those steps do not produce the error for me. Only switching folders (to one with a previously opened terminal, which is what OP was ) produces this issue
The terminal process ... terminated with exit code: -1073741510.
affects all terminal types, not just powershell
Issue does not occur on insider build at all as far as I can tell (regardless of conpty setting). It does occur in release build.
✅ I can repro on 1.98.1 but not on the 1.98.2 candidate.
@deepak1556 , the clarity @unsivilaudio audio provided about the steps to reproduce is correct.
My original steps to reproduce may not be clear so I have attempted to clarify them. Happy to clarify further if needed, just let me know!
- Be running Windows 11 24H2 and Visual Studio Code 1.98.0
- Open Visual Studio Code.
- Open a folder (
File -> Open Folder) with a Git repository and launch a terminal (Terminal -> New Terminal) within Visual Studio Code. - Open another folder (
File -> Open Folder) with a Git repository and launch a terminal (Terminal -> New Terminal) within Visual Studio Code. - Open the first folder with a Git repository from step 2 with
File -> Open Recent. - PowerShell integrated terminal crashes with the error:
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe" terminated with exit code: -1073741510."
Yes, those steps produce that error on 1.98.1, not on insider (1.99.0). The conpty setting true/false does not matter on insider, no terminal crash regardless.