fix(core): suppress PTY resize EBADF errors (#27461)

This commit is contained in:
Tommaso Sciortino
2026-05-26 12:43:51 -07:00
committed by GitHub
parent 85563dabe8
commit 8b56d27901
2 changed files with 16 additions and 11 deletions
@@ -1517,12 +1517,13 @@ export class ShellExecutionService {
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const err = e as { code?: string; message?: string };
const isEsrch = err.code === 'ESRCH';
const isEbadf = err.code === 'EBADF' || err.message?.includes('EBADF');
const isWindowsPtyError = err.message?.includes(
'Cannot resize a pty that has already exited',
);
if (isEsrch || isWindowsPtyError) {
// On Unix, we get an ESRCH error.
if (isEsrch || isEbadf || isWindowsPtyError) {
// On Unix, we get an ESRCH or EBADF error.
// On Windows, we get a message-based error.
// In both cases, it's safe to ignore.
} else {