@@ -46,7 +46,7 @@ declare const $: any;
46
46
const SCROLLBACK = 5000 ;
47
47
const MAX_HISTORY_LENGTH = 100 * SCROLLBACK ;
48
48
49
- const MAX_DELAY = 15000 ;
49
+ // const MAX_DELAY = 15000;
50
50
51
51
const ENABLE_WEBGL = false ;
52
52
@@ -77,9 +77,9 @@ export class Terminal<T extends CodeEditorState = CodeEditorState> {
77
77
private pauseKeyCount : number = 0 ;
78
78
private keyhandler_initialized : boolean = false ;
79
79
// last time user typed something
80
- private lastSend = 0 ;
80
+ // private lastSend = 0;
81
81
// last time we received data back from project
82
- private lastReceive = 0 ;
82
+ // private lastReceive = 0;
83
83
/* We initially have to ignore when rendering the initial history.
84
84
To TEST this, do this in a terminal, then reconnect:
85
85
printf "\E[c\n" ; sleep 1 ; echo
@@ -187,7 +187,7 @@ export class Terminal<T extends CodeEditorState = CodeEditorState> {
187
187
this . init_settings ( ) ;
188
188
this . init_touch ( ) ;
189
189
this . set_connection_status ( "disconnected" ) ;
190
- this . reconnectIfNotResponding ( ) ;
190
+ // this.reconnectIfNotResponding();
191
191
192
192
// The docs https://xtermjs.org/docs/api/terminal/classes/terminal/#resize say
193
193
// "It’s best practice to debounce calls to resize, this will help ensure that
@@ -320,10 +320,10 @@ export class Terminal<T extends CodeEditorState = CodeEditorState> {
320
320
ephemeral : EPHEMERAL ,
321
321
} ) ;
322
322
this . conn = conn as any ;
323
- conn . on ( "close" , this . connect ) ;
323
+ conn . once ( "close" , this . connect ) ;
324
324
conn . on ( "kick" , this . close_request ) ;
325
325
conn . on ( "data" , this . handleDataFromProject ) ;
326
- conn . on ( "init" , ( data ) => {
326
+ conn . once ( "init" , ( data ) => {
327
327
this . terminal . clear ( ) ;
328
328
this . render ( data ) ;
329
329
} ) ;
@@ -371,19 +371,19 @@ export class Terminal<T extends CodeEditorState = CodeEditorState> {
371
371
return ;
372
372
}
373
373
this . conn . write ( data ) ;
374
- this . lastSend = Date . now ( ) ;
374
+ // this.lastSend = Date.now();
375
375
} ;
376
376
377
377
// this should never ever be necessary. It's a just-in-case things
378
378
// were myseriously totally broken measure...
379
- private reconnectIfNotResponding = async ( ) => {
380
- while ( this . state != "closed" ) {
381
- if ( this . lastSend - this . lastReceive >= MAX_DELAY ) {
382
- await this . connect ( ) ;
383
- }
384
- await delay ( MAX_DELAY / 2 ) ;
385
- }
386
- } ;
379
+ // private reconnectIfNotResponding = async () => {
380
+ // while (this.state != "closed") {
381
+ // if (this.lastSend - this.lastReceive >= MAX_DELAY) {
382
+ // await this.connect();
383
+ // }
384
+ // await delay(MAX_DELAY / 2);
385
+ // }
386
+ // };
387
387
388
388
private handleDataFromProject = ( data : any ) : void => {
389
389
this . assert_not_closed ( ) ;
@@ -399,7 +399,7 @@ export class Terminal<T extends CodeEditorState = CodeEditorState> {
399
399
} ;
400
400
401
401
private activity = ( ) => {
402
- this . lastReceive = Date . now ( ) ;
402
+ // this.lastReceive = Date.now();
403
403
this . project_actions . flag_file_activity ( this . path ) ;
404
404
} ;
405
405
0 commit comments