Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Bug: Terminal character echo and false exit code 1

Open oliviapoolewoodmac-lab opened this issue 5 months ago • 8 comments

Before opening, please confirm:

Operating System

win32

Kiro Version

1.0.0

Bug Description

Environment:

OS: Windows (win32) Workspace path: OneDrive-synced folder (C:\Users...\OneDrive - Wood Mackenzie Limited\Documents\Kiro) Shells tested: Both Command Prompt and PowerShell Persists after full Kiro restart

Observed behavior: When Kiro's agent executes terminal commands, the output shows incremental character-by-character echoing before the full command executes. For example, running echo "terminal test" produces: e> echo "termi echo "termin echo "termina echo "terminal echo "terminal echo "terminal t echo "terminal te echo "terminal tes echo "terminal test

echo "terminal test" terminal test The command does eventually execute and produce correct output, but: Every character of the input is echoed incrementally as if being typed one keystroke at a time The exit code is always reported as 1 (failure) even when the command succeeds Extra shell prompt fragments and path information are injected into the output

Impact: Agent terminal tool is unreliable for parsing output Exit code 1 causes the tool to report errors even on successful commands Affects both cmd and PowerShell profiles

Steps to reproduce: Open Kiro in a workspace on a OneDrive-synced path Have the agent run any terminal command (e.g. echo "test" or dir) Observe character echo in output

Notes: File operations (read, write, search) work fine — only the terminal tool is affected Restarting Kiro does not resolve the issue Switching default terminal profile between cmd and PowerShell does not resolve the issue

Steps to Reproduce

Open Kiro in a workspace on a OneDrive-synced path Have the agent run any terminal command (e.g. echo "test" or dir) Observe character echo in output

Expected Behavior

Running echo "terminal test" should produce clean output like:

terminal test With exit code 0 (success).

There should be:

No incremental character echoing No shell prompt fragments in the output No path strings injected between lines Exit code 0 for commands that succeed Essentially, the terminal should behave like a non-interactive shell — receive the full command, execute it, return the output and correct exit code. The same way it would work if you piped a command into cmd /c or powershell -Command directly.

Conversation ID

No response

Additional Context

No response

oliviapoolewoodmac-lab avatar Jul 02 '26 12:07 oliviapoolewoodmac-lab

Thanks for opening this issue and providing such a detailed report! The character-by-character echoing and false exit codes in the terminal tool on Windows sounds frustrating, and we appreciate you testing across both Command Prompt and PowerShell to help narrow things down. A maintainer will review this shortly — your thorough reproduction steps will really help us investigate. Thanks for helping make Kiro better! 🙌

github-actions[bot] avatar Jul 02 '26 12:07 github-actions[bot]

Thanks for reporting this and sorry for the trouble. You're on version 1.0.52, and we've since shipped several releases with targeted fixes:

  • 1.0.89 (Jul 3): Performance, dependency fixes
  • 1.0.116 (Jul 9): Connectivity fixes
  • 1.0.138 (Jul 13): PowerShell trust on Windows, terminal improvements, MCP network recovery

Could you please retest on the latest version (1.0.138) from https://kiro.dev/downloads and let us know if this is still an issue? If we don't hear back within 7 days, we'll assume it's resolved and close this out.

AnilMaktala avatar Jul 15 '26 19:07 AnilMaktala

I have updated my version to 1.0.138, but the character-by-character echoing issue is still present, and the exit code reporting is unreliable (it shows exit code 1 even though the real problem is the garbled output, not a genuine failure).

oliviapoolewoodmac-lab avatar Jul 16 '26 13:07 oliviapoolewoodmac-lab

Experiencing this as well on Windows. Workspace is on a non-OneDrive path (separate drive), so it doesn't appear to be OneDrive-related. Been seeing this for a few weeks now. Currently on v1.0.182.

MikeORed avatar Jul 20 '26 20:07 MikeORed

I get this same issue on 1.0.116 - it's making Kiro virtually unusable

rohancragg avatar Sep 09 '26 14:09 rohancragg

Same root cause as #10810, and it is not the terminal profile or OneDrive.

On Windows 11 / Kiro 1.0.437 I traced identical symptoms (character-by-character echo, constant false exit code, injected shell path fragments) to the PowerShell execution policy. Kiro dot-sources shellIntegration.ps1 at shell startup, which requires execution policy permission. With the effective policy at Restricted (the default when all scopes are Undefined), it throws PSSecurityException / UnauthorizedAccess and Kiro's empty catch {} discards the error silently.

Integration never installs, so no OSC 633 markers are emitted. Kiro then fabricates an exit code and falls back to scraping the raw terminal buffer, which contains PSReadLine's per-keystroke redraws — that is the character echo.

Quick check:

Get-ExecutionPolicy                       # Restricted?
Test-Path variable:global:__VSCodeState   # False = never loaded

Fix: Set-ExecutionPolicy -Scope CurrentUser RemoteSigned, then restart the terminal. This also explains why switching between cmd and PowerShell profiles and restarting Kiro made no difference — none of those change the policy.

Full write-up and suggested upstream fix (-ExecutionPolicy Bypass, per microsoft/vscode#199122) in my comment on #10810.

SlipstreamZA avatar Sep 13 '26 19:09 SlipstreamZA

I worked through your solution and it seems to have been successful! Thank you very much, hope this is helpful to others having this issue

oliviapoolewoodmac-lab avatar Sep 14 '26 10:09 oliviapoolewoodmac-lab

Glad it's fixed for you @oliviapoolewoodmac-lab but the fix doesn't resolve this for me as I've noted in #issuecomment-5664246486

rohancragg avatar Sep 14 '26 13:09 rohancragg