Total catastrophic failure of powershell terminal to do literally anything + fix
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
Windows 11 Pro 64 bit
Kiro Version
0.5.35
Bug Description
Kiro Bug Report: Corrupted shellIntegration.ps1 Causes Terminal Failure
Summary
Kiro ships with a corrupted shellIntegration.ps1 file that causes all terminal operations to fail with ERROR_INVALID_IMAGE_HASH (-2147023895). The corrupted script crashes PowerShell on execution, preventing any terminal functionality in Kiro.
Environment
- OS: Windows 10/11
- Kiro Version: Latest (as of November 15, 2025)
- Installation Type: Fresh install
- PowerShell Version: 5.1.26100.7019
Steps to Reproduce
- Install Kiro fresh on Windows
- Attempt to open integrated terminal (Ctrl+` or Terminal menu)
- Observe error popup: "The terminal process terminated with exit code: -2147023895"
- All
executePwshcommands fail with "Signal was cancelled"
Expected Behavior
- Terminal should open successfully
- PowerShell should start with shell integration enabled
- Commands should execute normally
Actual Behavior
- Terminal fails to open
- Error popup appears: "The terminal process terminated with exit code: -2147023895"
- Windows Event Viewer shows PowerShell startup logs but immediate termination
- All process spawning in Kiro fails
Root Cause
The file shellIntegration.ps1 located at:
C:\Users\[User]\AppData\Local\Programs\Kiro\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1
Is corrupted or malformed. When PowerShell attempts to execute this script (via -command try { . "shellIntegration.ps1" } catch {}), it:
- First execution: Produces no output
- Second execution: Crashes PowerShell entirely
- Causes Windows to return ERROR_INVALID_IMAGE_HASH
Technical Details
Error Code
- Exit Code: -2147023895
- Hex: 0x800703E9
- Windows Error: ERROR_INVALID_IMAGE_HASH
- Meaning: "The hash for the image cannot be found in the system catalogs. The image is likely corrupt or the victim of tampering."
Script Status
Get-AuthenticodeSignature "...\shellIntegration.ps1"
Status: NotSigned
The script is unsigned (expected) but also corrupted/malformed.
PowerShell Event Logs
Event Viewer shows PowerShell starting with the command:
powershell.exe -noexit -command try { . "c:\Users\User\AppData\Local\Programs\Kiro\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1" } catch {}
But immediately terminates with ERROR_INVALID_IMAGE_HASH.
Workaround
Replace the corrupted file with a clean version from VS Code repository:
- Rename broken file:
Rename-Item "C:\Users\[User]\AppData\Local\Programs\Kiro\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1" "shellIntegration.ps1.broken"
- Download clean version from:
https://github.com/microsoft/vscode/raw/main/src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1
- Place in same directory
- Restart Kiro
Terminal functionality is restored immediately.
Impact
- Severity: Critical
- Affected Users: All Windows users with fresh Kiro installations
- Workaround Available: Yes (manual file replacement)
Questions for Kiro Team
-
How is this file corrupted in the distribution?
- Build process issue?
- Packaging problem?
- Code signing issue?
-
Why doesn't Kiro validate this file on startup?
- Could add integrity check for critical shell integration scripts
- Could provide better error messages when script fails
-
Why does the error message not indicate the actual problem?
- "Signal was cancelled" is misleading
- Should show "Shell integration script failed" or similar
- Should log the actual PowerShell error
-
Is this affecting other platforms?
- Does the bash/zsh equivalent have similar issues?
Suggested Fixes
Immediate
- Fix the build/packaging process that's corrupting shellIntegration.ps1
- Add file integrity validation on Kiro startup
- Provide fallback behavior if shell integration fails (open terminal without integration)
Long-term
- Improve error messages for terminal failures
- Add diagnostic tool to check shell integration health
- Provide in-app repair option for corrupted files
- Better logging of terminal startup failures
Additional Notes
What Didn't Work (Red Herrings)
- Running as Administrator
- Reinstalling Kiro
- Running SFC /scannow
- Running DISM
- Updating NVIDIA drivers (initially suspected due to unrelated service crashes)
- Disabling Code Integrity policies
- Changing PowerShell execution policy (already Bypass)
- Checking AppLocker policies
- Checking Windows Defender Application Control
What Actually Worked
- Replacing the corrupted shellIntegration.ps1 file with a clean version
Reproduction Rate
100% on affected installations. The corrupted file is consistently present in fresh Kiro installations.
Files to Investigate
- Build scripts that package shellIntegration.ps1
- Code signing process for Kiro distribution
- File integrity checks during installation
- Error handling in terminal initialization code
Submitted by: User experiencing critical terminal failure Date: November 15, 2025 Time to Resolution: ~3 hours of troubleshooting Workaround Effectiveness: 100% - immediate fix upon file replacement
Steps to Reproduce
Download latest Kiro for Windows Install Try to open terminal
Expected Behavior
It should, yknow, open the terminal and let you do stuff using it.
Conversation ID
386d4d27-9f16-43e9-892d-d3bf1a7fbb2f
Additional Context
No response
Seems like this is solvable by updating PowerShell to the latest version. I found 7.5.4.0 to restore all shell function in Kiro.
https://learn.microsoft.com/en-us/powershell/scripting/install/install-powershell-on-windows?view=powershell-7.5