fix: Ignore correct errors thrown when resizing or scrolling an exited pty (#11440)

This commit is contained in:
Mayur Vaid
2025-10-22 09:57:49 +05:30
committed by GitHub
parent c7243997f4
commit 2940b50811
2 changed files with 53 additions and 1 deletions
@@ -750,7 +750,11 @@ export class ShellExecutionService {
} catch (e) {
// Ignore errors if the pty has already exited, which can happen
// due to a race condition between the exit event and this call.
if (e instanceof Error && 'code' in e && e.code === 'ESRCH') {
if (
e instanceof Error &&
(('code' in e && e.code === 'ESRCH') ||
e.message === 'Cannot resize a pty that has already exited')
) {
// ignore
} else {
throw e;