Allow continuing on when term kill all doesn't succeed

Fixes #155817
This commit is contained in:
Daniel Imms 2022-07-21 16:32:25 -07:00
parent 0cf530cd3c
commit d2f3f7555b
No known key found for this signature in database
GPG key ID: 7116259D505CA628

View file

@ -93,7 +93,14 @@ export class Terminal {
await this._waitForTerminal(expectedLocation === 'editor' || commandId === TerminalCommandId.CreateNewEditor ? 'editor' : 'panel');
break;
case TerminalCommandId.KillAll:
await this.code.waitForElements(Selector.Xterm, true, e => e.length === 0);
// HACK: Attempt to kill all terminals to clean things up, this is known to be flaky
// but the reason why isn't known. This is typically called in the after each hook,
// Since it's not actually required that all terminals are killed just continue on
// after 2 seconds.
await Promise.race([
this.code.waitForElements(Selector.Xterm, true, e => e.length === 0),
new Promise<void>(r => setTimeout(r, 2000))
]);
break;
}
}