Skip to content

CLI Crashes on Windows with "Cannot resize a pty that has already exited" #10258

Description

@iceman3k

What happened?

The Gemini CLI crashes on Windows when attempting to execute a chmod +x command.

Steps to Reproduce:

  1. Launch the Gemini CLI on a Windows machine.
  2. Ask the agent to execute a chmod +x command on any file. For example:
    chmod +x C:\Users\Kris\stremio-nvenc\stremio-docker-nvidia\entrypoint.sh
  3. The CLI crashes instantly.

What did you expect to happen?

The CLI should not crash. It should handle the error gracefully by reporting that chmod is not a recognized command on Windows.

Client information

  • CLI Version: 0.6.1
  • Git Commit: f307813
  • Session ID: 44e0bd13-5b49-4cce-857f-3527082e3302
  • Operating System: win32 v22.20.0
  • Sandbox Environment: no sandbox
  • Model Version: gemini-2.5-pro
  • Memory Usage: 205.4 MB

Login information

Google Account OAUTH

Anything else we need to know?

This crash occurs because chmod is not a native Windows cmd.exe command. The shell process inside the pseudo-terminal
exits immediately upon receiving the invalid command, but the CLI tool subsequently attempts to interact with the
now-defunct terminal, leading to a fatal error.

Full Error Log:
`
C:\Users\Kris\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\Kris\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsPtyAgent.js:93:19)
at WindowsTerminal. (C:\Users\Kris\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell
\node-pty\windowsTerminal.js:131:26)
at Object.run (C:\Users\Kris\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windows
Terminal.js:167:50)
at
C:\Users\Kris\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\windowsTerminal.js:73:32
at Array.forEach ()
at Socket.
(C:\Users\Kris\AppData\Roaming\npm\node_modules@google\gemini-cli\node_modules@lydell\node-pty\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
`

Metadata

Metadata

Assignees

Labels

area/platformIssues related to Build infra, Release mgmt, Testing, Eval infra, Capacity, Quota mgmtpriority/p2Important but can be addressed in a future release.

Type

No fields configured for Bug.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions