Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

Window - Kiro prepends a cd command that is breaking

Open nerd-shark opened this issue 1 year ago • 10 comments

Before opening, please confirm:

Operating System

win32

Kiro Version

0.6.29

Bug Description

Kiro starts to prepend a cd "c:\Path\to\root" command to the desired command and it's breaking.

There's still an issue with the command execution. Let me try without the path parameter:

Command python shared\libraries\nagara-doc-generator\test_s3_footnotes.py you are still appending cd command

You're absolutely right. Let me just run the command without any path parameter:

Command python shared\libraries\nagara-doc-generator\test_s3_footnotes.py cd "c:\Users\3717246\Repos\Nagara" ; python shared
\libraries\nagara-doc-generator\test_s3_footnotes.py The system cannot find the path specified. :\WINDOWS\system32\cmd.EXE - cd "c:\Users\3717246\Repos\Nagara" ; python shared\libraries\nagara-doc-generator\test_s3_footnotes.py :\WINDOWS\system32\cmd.EXE C:\Users\3717246\Repos\Nagara I see the issue - the tool is automatically prepending the cd command. This appears to be a system behavior I cannot control. Can you run the command directly in your terminal?

Steps to Reproduce

  1. open kiro start spec commands - in terminal navigate to non-root directory
  2. wait for kiro to request a command
  3. approve command
    1. kiro prepends cd "c:\Path\to\root"; [desired command]
  4. it failes.

Expected Behavior

i expect kiro to be able to cd to the necessary directory without error.

Conversation ID

b0dc0e6e-ddc3-4745-a46d-3efbdf54ea65 2c046672-9ce2-46e5-bb38-8148aaabd089 b62ea30f-719d-4498-b43b-d47706b248e3

Additional Context

No response

nerd-shark avatar Nov 29 '25 11:11 nerd-shark

I have the same issue, version 0.7.34

I tried it on Windows and also remote in WSL.

smeury avatar Dec 12 '25 16:12 smeury

The same issue, anyone has solution?

Morizady avatar Dec 25 '25 02:12 Morizady

FOUND IT!!!

Image

In settings, we can find the [Terminal › Integrated › Suggest: Cd Path].

If we set this option to absolute, kiro will append the "cd" command to my target command and use semi colon-separated on Windows.

Maybe we should disable this option.

Morizady avatar Dec 25 '25 03:12 Morizady

issue still occurs even with Morizady's work around above.

nerd-shark avatar Jan 09 '26 11:01 nerd-shark

@nerd-shark, are you experiencing this in the latest version (0.8.86)?

AnilMaktala avatar Jan 09 '26 21:01 AnilMaktala

Yes- especially if I'm working in a subdirectory. I can sometimes tell it not to use the path parameter, which works sometimes, but not always.In fact, the agent has a hard time managing changing directories in general- I often have to manage directory changes for it.On Jan 9, 2026, at 16:23, Anil Maktala @.***> wrote:AnilMaktala left a comment (kirodotdev/Kiro#4100) @nerd-shark, are you experiencing this in the latest version (0.8.86)?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

nerd-shark avatar Jan 09 '26 23:01 nerd-shark

Experiencing this on Windows + WSL. Setting the "Suggest CD Path" option from absolute to relative or off does not seem to have any effect on the execution, even after restarting the IDE.

astuomi avatar Jan 11 '26 13:01 astuomi

Hey @nerd-shark, Thanks for confirming. I will mark this as bug for the team to evaluate further.

AnilMaktala avatar Jan 16 '26 14:01 AnilMaktala

I think I found the root cause - see solution below.

The issue is that Kiro does not understand the commands are being run in a WSL (linux) environment and therefore tries to use the Windows path. I could not find an option to change this behavior or instruct Kiro to use linux-formatted paths, which would solve the issue.

Workaround:

Create a cd function in your shell .rc file that calls wslpath to resolve Windows paths to Linux paths if a Windows path argument (<drive>:\) is detected.

Add this to your .bashrc (or other shell .rc) and start a new terminal session:

function cd() {
    if [[ $1 == ?':\'* ]]; then
        \builtin cd $(wslpath "$1")
    else
        \builtin cd $1
    fi
}

You should find that Windows path cd commands are handled as expected.

If you experience issues, make sure your Kiro terminal session does indeed load the rc file as expected.

EDIT: In hindsight, this might not apply for the original issue by the original poster, but might help other people reaching this post through a search, so I will leave the comment here unless it is better removed.

astuomi avatar Apr 18 '26 04:04 astuomi

Closing this issue as it was reported against an older version of Kiro (v0.x or early v1.x) and has had no activity in several months.

Kiro has shipped significant improvements since these versions, including stability fixes, new features, and major changes across v1.0, v1.1, v2.x, and the current v2.23.x releases. The behavior described here may already be resolved.

If this is still affecting you on the latest version, please open a new issue at https://github.com/kirodotdev/Kiro/issues/new with your current version (kiro-cli --version or Help > About in the IDE), your OS, and steps to reproduce. The latest version is available at https://kiro.dev/downloads/ or via kiro-cli update.

Thank you for taking the time to report this.

AnilMaktala avatar Sep 24 '26 13:09 AnilMaktala