Skip to content

fix: add -NoProfile flag to PowerShell subprocess invocation#1464

Open
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/powershell-noprofile
Open

fix: add -NoProfile flag to PowerShell subprocess invocation#1464
Br1an67 wants to merge 1 commit intoMoonshotAI:mainfrom
Br1an67:fix/powershell-noprofile

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 17, 2026

Problem

On Windows, Kimi CLI runs PowerShell without -NoProfile, causing the user's profile to load. If the profile contains UI commands (e.g., setting CursorPosition), they fail in the non-interactive subprocess, making the Shell tool completely unusable.

Fix

Add -NoProfile flag before -command in _shell_args() (tools/shell/__init__.py).

Fixes #1341


Open with Devin

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

On Windows, PowerShell loads the user profile by default, which may
contain UI-related commands (e.g., setting CursorPosition) that fail
in a non-interactive subprocess environment. This causes all shell
commands to timeout with 'The handle is invalid' errors.

Add -NoProfile flag to skip profile loading in the shell tool's
PowerShell subprocess calls.

Fixes MoonshotAI#1341
@Br1an67 Br1an67 force-pushed the fix/powershell-noprofile branch from 8b81d24 to 12f8c38 Compare March 17, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows Shell Commands Failing - PowerShell subprocess handling bug in Kimi CLI

1 participant