Skip to content

Commit 8b81d24

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 94212ea commit 8b81d24

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
@@ -123,5 +123,5 @@ async def _read_stream(stream: AsyncReadable, cb: Callable[[bytes], None]):
123123

124124
def _shell_args(self, command: str) -> tuple[str, ...]:
125125
if self._is_powershell:
126-
return (str(self._shell_path), "-command", command)
126+
return (str(self._shell_path), "-NoProfile", "-command", command)
127127
return (str(self._shell_path), "-c", command)

0 commit comments

Comments
 (0)