Windows crash on Node.js v22 – "Cannot resize a pty that has already exited"
维护者通常 1 天内回复
评估
- 难度
- 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 内容生成。
描述
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:
- Install Node.js v22.12.0 on Windows 11.
- Install @google/gemini-cli globally (
npm install -g @google/gemini-cli). - Run a command that triggers an interactive PTY session (e.g. rebasing workflow).
- 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 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/node-pty 的其他 Issue
-
spawn drops an own `__proto__` environment entry可能已有人在做 @nikolay-dementiev 于 6 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ConPTY/TSFN exit callback aborts the process during environment teardown — fixable with NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS (same root cause as #904)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/node-pty#951 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
查看 microsoft/node-pty 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
mobile-next/mobile-mcp#526 ·
维护者通常 1 天内回复
-
e2e-failure ready-to-code
难度 1/5 1 小时以内 新手友好度 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 条评论 ·
维护者通常 1 天内回复