Bug: CLI crashes with "Cannot resize a pty that has already exited" error after executing a shell command on Windows
What happened?
When using the Gemini CLI on a Windows machine, executing a simple, non-interactive shell command (like rmdir or del) causes the entire client to crash immediately after the command completes successfully.
Steps to Reproduce:
Start the Gemini CLI in a Windows Terminal or PowerShell.
Run a simple shell command that finishes quickly, for example: !rmdir /s /q my_test_folder
The command executes correctly (the folder is deleted).
The CLI immediately crashes and exits, displaying the error below.
The crash produces the following error and stack trace:
Click to view Error and Stack Trace
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (C:\Users\kiwoong\AppData\Roaming\npm\node_modules@google\ge)
at WindowsTerminal.
What did you expect to happen?
After the shell command executed successfully, the Gemini CLI should have remained running and ready to accept the next user command.
Client information
Below is the output from the /about command.
Platform: Windows
- CLI Version: 0.10.0-nightly.20251013.cfb71b9d
- Git Commit: cfb71b9d
- Session ID: ce1ab48b-533d-4baa-856b-ae4799a63928
- Operating System: win32 v22.20.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-pro
- Memory Usage: 202.6 MB
Login information
Logged in using a standard Google Account with web-based authentication.
Anything else we need to know?
This issue seems to be specific to the Windows environment.
The problem is likely related to how the pseudo-terminal (pty) is handled after a process terminates. The crash is not limited to the rmdir command; it occurs consistently with other simple shell commands that finish quickly.
same here.
It's a terrible problem. But I think it's solved by using wsl.