fix(core): harden PTY resize against native crashes (#27496)

This commit is contained in:
Tommaso Sciortino
2026-05-28 09:16:24 -07:00
committed by GitHub
parent 5cac7c10fa
commit bd53951dc8
2 changed files with 40 additions and 22 deletions
+5 -2
View File
@@ -21,9 +21,12 @@ import {
// Tracking bug: https://github.com/microsoft/node-pty/issues/827
process.on('uncaughtException', (error) => {
if (error instanceof Error) {
const message = error.message || '';
const isPtyResizeError =
error.message === 'Cannot resize a pty that has already exited';
const isEbadfError = error.message.includes('EBADF');
message === 'Cannot resize a pty that has already exited';
const isEbadfError =
message.includes('EBADF') ||
(error as { code?: string }).code === 'EBADF';
const isFromNodePty =
error.stack?.includes('node-pty') || error.stack?.includes('PtyResize');