File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -648,6 +648,7 @@ abstract class Connection {
648648 this . startReaduntil ( "KeyboardInterrupt:" ) ;
649649 await this . writeToDevice ( "\r" + this . CTRL_CMD_KINTERRUPT ) ; // ctrl-C to interrupt any running program
650650 let result = await this . haltUntilRead ( 1 , 20 ) ;
651+
651652 if ( result == undefined ) {
652653 this . startReaduntil ( ">>>" ) ;
653654 await this . writeToDevice ( "\r" + this . CTRL_CMD_NORMALMODE ) ; // ctrl-C to interrupt any running program
@@ -656,17 +657,22 @@ abstract class Connection {
656657 return true ;
657658 }
658659 }
660+
659661 //try multiple times to get to the prompt
660662 let gotToPrompt = false ;
661663 for ( let i = 0 ; i < 20 ; i ++ ) {
662664 this . startReaduntil ( ">>>" ) ;
663- await this . writeToDevice ( "\r" + this . CTRL_CMD_KINTERRUPT ) ;
664- result = await this . haltUntilRead ( 2 , 5 ) ; //this should be fast
665+ await this . writeToDevice ( "\r" + this . CTRL_CMD_KINTERRUPT + this . CTRL_CMD_KINTERRUPT ) ;
666+ result = await this . haltUntilRead ( 0 , 5 ) ; //this should be fast
665667 if ( result != undefined && result . length > 0 ) {
666668 gotToPrompt = true ;
667669 break ;
668670 }
669671 }
672+
673+ this . startReaduntil ( ">>>" ) ;
674+ await this . writeToDevice ( "\r" + this . CTRL_CMD_NORMALMODE ) ; // ctrl-C to interrupt any running program
675+ result = await this . haltUntilRead ( 1 , 20 ) ;
670676 return gotToPrompt ;
671677 }
672678 async prepareForStop ( ) {
You can’t perform that action at this time.
0 commit comments