CLI crashes with "Cannot resize a pty that has already exited" on Windows
What happened?
The Gemini model attempted to execute a del command via the run_shell_command tool on a Windows machine. The command was intended to delete a file. Immediately upon execution, the Gemini CLI crashed with a node-pty error.
Here is the stack trace:
` C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93 throw new Error('Cannot resize a pty that has already exited'); ^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\no
de-pty\windowsPtyAgent.js:93:19)
at WindowsTerminal.
Node.js v22.20.0 `
What did you expect to happen?
The CLI should have executed the del command without crashing. If the command failed for any reason (e.g., file not found), it should have reported the error from the shell command rather than causing the entire CLI tool to exit.
Client information
- CLI Version: 0.6.1 As the AI model, I do not have access to this information. Please fill this in with your login method (e.g., Google Account, API key).
Client information
- CLI Version: 0.6.1
- Git Commit: f3078136
- Session ID: 48809cab-9697-43c8-aa1b-20f49d292b32
- Operating System: win32 v22.20.0
- Sandbox Environment: no sandbox
- Model Version: gemini-2.5-pro
- Memory Usage: 221.2 MB
Login information
Google Account, OAUTH
Anything else we need to know?
The specific command being run was del C:\Users<user>\stremio-nvenc\mcp\Summary_Past_Attemps.txt. It's possible the file did not exist at the time of execution, which may have contributed to the pty process exiting unexpectedly, leading to the crash when the CLI tried to interact with it.
Fyi @galz10 in case you believe you have already fixed this.
Another similar bug has been reported here - #10258 and hence marking this bug as duplicate.
C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93 throw new Error('Cannot resize a pty that has already exited'); ^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93:19)
at WindowsTerminal.
Node.js v23.11.1
C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93 throw new Error('Cannot resize a pty that has already exited'); ^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\no)
at WindowsTerminal.
TODAY
When you guys are gona fix this: is tooooo anoying you start working and woithout a reason gemini simply quit an this message appears... its an error over Node? is there a version that stabilizes gemini? I have tried 18, 19, 20, 22, 23 and 24... and nothig.. theerror persists.... C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modules@google\gemini-cli\node_modules@3 throw new Error('Cannot resize a pty that has already exited'); ^
Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modules@g)
at WindowsTerminal.
Node.js v24.10.0
This persistent issue is preventing me from using gemini-cli entirely.