mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
do not timeout on faulty async handlers, continue with false to give default handlers chance to run
This commit is contained in:
@@ -484,8 +484,13 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
private _logSlowResolvingAsync(p: Promise<boolean>): void {
|
||||
// log a limited warning about an async taking too long
|
||||
if ((this._logService as any)._logLevel <= LogLevel.WARN) {
|
||||
Promise.race([p, new Promise((res, rej) => setTimeout(rej, SLOW_ASYNC_LIMIT))])
|
||||
.catch(() => console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`));
|
||||
Promise.race([p, new Promise((res, rej) => setTimeout(() => rej('#SLOW_TIMEOUT'), SLOW_ASYNC_LIMIT))])
|
||||
.catch(err => {
|
||||
if (err !== '#SLOW_TIMEOUT') {
|
||||
throw err;
|
||||
}
|
||||
console.warn(`async parser handler taking longer than ${SLOW_ASYNC_LIMIT} ms`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ export class WriteBuffer {
|
||||
// (executed on the same queue, thus properly aligned before continuation happens)
|
||||
result.catch(err => {
|
||||
qmt(() => {throw err;});
|
||||
return Promise.resolve(true);
|
||||
return Promise.resolve(false);
|
||||
}).then(continuation);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user