gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

CLI crashes with "Cannot resize a pty that has already exited" on Windows

Open iceman3k opened this issue 1 year ago • 6 comments

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. (C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lyde ll\node-pty\windowsTerminal.js:131:26) at Object.run (C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windo wsTerminal.js:167:50) at C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:73:32 at Array.forEach () at Socket. (C:\Users<user>\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-p ty\windowsTerminal.js:68:42) at Socket.emit (node:events:531:35) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5)

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.

iceman3k avatar Oct 01 '25 18:10 iceman3k

Fyi @galz10 in case you believe you have already fixed this.

jacob314 avatar Oct 08 '25 21:10 jacob314

Another similar bug has been reported here - #10258 and hence marking this bug as duplicate.

MayV avatar Oct 15 '25 18:10 MayV

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. (C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:131:26) at Object.run (C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:167:50) at C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:73:32 at Array.forEach () at Socket. (C:\Users\norberto.lodela\AppData\Roaming\nvm\v23.11.1\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:68:42) at Socket.emit (node:events:519:35) at addChunk (node:internal/streams/readable:559:12) at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) at Readable.push (node:internal/streams/readable:390:5)

Node.js v23.11.1

lodela avatar Oct 17 '25 16:10 lodela

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. (C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lyde) at Object.run (C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windo) at C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.j2 at Array.forEach () at Socket. (C:\Users\3ky\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-p) at Socket.emit (node:events:530:35) at addChunk (node:internal/streams/readable:561:12) at readableAddChunkPushByteMode (node:internal/streams/readable:512:3) at Readable.push (node:internal/streams/readable:392:5)

TODAY

dcollaoa avatar Oct 28 '25 16:10 dcollaoa

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. (C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modul) at Object.run (C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modules@google\gemini) at C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modules@google\gemini-cli\node_mo2 at Array.forEach () at Socket. (C:\Users\norberto.lodela\AppData\Roaming\nvm\v24.10.0\node_modules@googl) at Socket.emit (node:events:520:35) at addChunk (node:internal/streams/readable:559:12) at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) at Readable.push (node:internal/streams/readable:390:5)

Node.js v24.10.0

lodela avatar Oct 28 '25 20:10 lodela

This persistent issue is preventing me from using gemini-cli entirely.

comaeclipse avatar Nov 26 '25 18:11 comaeclipse