File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ export enum HeartbeatConstants {
392392 * The duration between heartbeats
393393 */
394394 BeatInterval = 5000 ,
395+ /**
396+ * The duration of the first heartbeat while the pty host is starting up. This is much larger
397+ * than the regular BeatInterval to accomodate slow machines, we still want to warn about the
398+ * pty host's unresponsiveness eventually though.
399+ */
400+ ConnectingBeatInterval = 20000 ,
395401 /**
396402 * Defines a multiplier for BeatInterval for how long to wait before starting the second wait
397403 * timer.
Original file line number Diff line number Diff line change @@ -149,8 +149,7 @@ export class PtyHostService extends Disposable implements IPtyService {
149149 // Setup heartbeat service and trigger a heartbeat immediately to reset the timeouts
150150 const heartbeatService = ProxyChannel . toService < IHeartbeatService > ( client . getChannel ( TerminalIpcChannels . Heartbeat ) ) ;
151151 heartbeatService . onBeat ( ( ) => this . _handleHeartbeat ( ) ) ;
152- // TODO: Starting the heartbeat tracking now causes problems
153- this . _handleHeartbeat ( ) ;
152+ this . _handleHeartbeat ( true ) ;
154153
155154 // Handle exit
156155 this . _register ( connection . onDidProcessExit ( e => {
@@ -351,9 +350,9 @@ export class PtyHostService extends Disposable implements IPtyService {
351350 this . _connection . store . dispose ( ) ;
352351 }
353352
354- private _handleHeartbeat ( ) {
353+ private _handleHeartbeat ( isConnecting ?: boolean ) {
355354 this . _clearHeartbeatTimeouts ( ) ;
356- this . _heartbeatFirstTimeout = setTimeout ( ( ) => this . _handleHeartbeatFirstTimeout ( ) , HeartbeatConstants . BeatInterval * HeartbeatConstants . FirstWaitMultiplier ) ;
355+ this . _heartbeatFirstTimeout = setTimeout ( ( ) => this . _handleHeartbeatFirstTimeout ( ) , isConnecting ? HeartbeatConstants . ConnectingBeatInterval : ( HeartbeatConstants . BeatInterval * HeartbeatConstants . FirstWaitMultiplier ) ) ;
357356 if ( ! this . _isResponsive ) {
358357 this . _isResponsive = true ;
359358 this . _onPtyHostResponsive . fire ( ) ;
You can’t perform that action at this time.
0 commit comments