Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Windows crash on Node.js v22 – "Cannot resize a pty that has already exited"

未关闭
#827 15 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

  • #900 来自 @euxaristia —— 已关闭,未合并
  • #901 来自 @euxaristia —— 已关闭,未合并

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
nodejs, typescript

调研方向

从 stack trace 中显示的 windowsPtyAgent.js 中的 WindowsPtyAgent.resize 路径和来自 windowsTerminal.js 的 resize 调用开始。使用 Node.js v22 在 Windows 11 上复现交互式 PTY 工作流,然后验证 PTY 退出后的 resize 不再导致未捕获的崩溃。

由索引模型根据 Issue 内容生成。

描述

bug help wanted

Environment:

  • OS: Windows 11
  • Node.js version: v22.12.0
  • Package: node-pty (via @lydell/node-pty, dependency of @google/gemini-cli)

Description:
When running @google/gemini-cli on Windows 11 with Node.js v22, the process crashes with the following error:

Error: Cannot resize a pty that has already exited
at WindowsPtyAgent.resize (node_modules/@lydell/node-pty/windowsPtyAgent.js:93:19)
at WindowsTerminal. (node_modules/@lydell/node-pty/windowsTerminal.js:131:26)
at Object.run (node_modules/@lydell/node-pty/windowsTerminal.js:167:50)
...

Steps to reproduce:

  1. Install Node.js v22.12.0 on Windows 11.
  2. Install @google/gemini-cli globally (npm install -g @google/gemini-cli).
  3. Run a command that triggers an interactive PTY session (e.g. rebasing workflow).
  4. Observe crash when the PTY process exits and resize is attempted.

Expected behavior:
Resize calls after PTY exit should fail gracefully or be ignored, not crash the entire process.

Actual behavior:
Process crashes with uncaught error "Cannot resize a pty that has already exited".

Notes:

  • This issue does not occur under Node.js v20 LTS.
  • It appears to be a runtime compatibility problem between node-pty and Node.js v22 ABI/stream changes.
  • Rebuilding node-pty from source (gyp_rebuild=true) does not resolve the runtime crash.

Request:
Please add compatibility support for Node.js v22 on Windows, or handle PTY resize calls more gracefully after exit.

主要语言
TypeScript
星标
2k
派生
347
平均合并
22 小时 24 分钟
30 天内合并 PR
6

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/node-pty 的其他 Issue

查看 microsoft/node-pty 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。