Skip to content

Commit 12f8c38

Browse files
committed
fix: add -NoProfile flag to PowerShell subprocess invocation
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 #1341
1 parent 7ba9695 commit 12f8c38

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/kimi_cli/tools/shell/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,5 @@ async def _read_stream(stream: AsyncReadable, cb: Callable[[bytes], None]):
127127

128128
def _shell_args(self, command: str) -> tuple[str, ...]:
129129
if self._is_powershell:
130-
return (str(self._shell_path), "-command", command)
130+
return (str(self._shell_path), "-NoProfile", "-command", command)
131131
return (str(self._shell_path), "-c", command)

0 commit comments

Comments
 (0)