Skip to content

Commit 86c90e6

Browse files
authored
Merge pull request microsoft#146271 from microsoft/tyriar/137893
Fire responsiveness events only on change
2 parents 8eecea7 + bce0a9e commit 86c90e6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vs/platform/terminal/node/ptyHostService.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ export class PtyHostService extends Disposable implements IPtyService {
343343
this._heartbeatFirstTimeout = setTimeout(() => this._handleHeartbeatFirstTimeout(), HeartbeatConstants.BeatInterval * HeartbeatConstants.FirstWaitMultiplier);
344344
if (!this._isResponsive) {
345345
this._isResponsive = true;
346+
this._onPtyHostResponsive.fire();
346347
}
347-
this._onPtyHostResponsive.fire();
348348
}
349349

350350
private _handleHeartbeatFirstTimeout() {
@@ -358,14 +358,17 @@ export class PtyHostService extends Disposable implements IPtyService {
358358
this._heartbeatSecondTimeout = undefined;
359359
if (this._isResponsive) {
360360
this._isResponsive = false;
361+
this._onPtyHostUnresponsive.fire();
361362
}
362-
this._onPtyHostUnresponsive.fire();
363363
}
364364

365365
private _handleUnresponsiveCreateProcess() {
366366
this._clearHeartbeatTimeouts();
367367
this._logService.error(`No ptyHost response to createProcess after ${HeartbeatConstants.CreateProcessTimeout / 1000} seconds`);
368-
this._onPtyHostUnresponsive.fire();
368+
if (this._isResponsive) {
369+
this._isResponsive = false;
370+
this._onPtyHostUnresponsive.fire();
371+
}
369372
}
370373

371374
private _clearHeartbeatTimeouts() {

0 commit comments

Comments
 (0)