This repository was archived by the owner on Nov 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed
Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ export default class GeneralStopCommand extends InstanceCommand {
1616
1717 instance . status ( Instance . STATUS_STOPPING ) ;
1818
19- if ( stopCommand . toLocaleLowerCase ( ) == "^c" ) {
20- instance . process . kill ( "SIGINT" ) ;
21- } else {
22- await instance . exec ( new SendCommand ( stopCommand ) ) ;
19+ const stopCommandList = stopCommand . split ( "\n" ) ;
20+ for ( const stopCommandColumn of stopCommandList ) {
21+ if ( stopCommandColumn . toLocaleLowerCase ( ) == "^c" ) {
22+ instance . process . kill ( "SIGINT" ) ;
23+ } else {
24+ await instance . exec ( new SendCommand ( stopCommandColumn ) ) ;
25+ }
2326 }
2427
2528 instance . println ( "INFO" , $t ( "general_stop.execCmd" , { stopCommand } ) ) ;
Original file line number Diff line number Diff line change @@ -17,8 +17,15 @@ export default class PtyStopCommand extends InstanceCommand {
1717 instance . status ( Instance . STATUS_STOPPING ) ;
1818
1919 instance . println ( "INFO" , $t ( "pty_stop.execCmd" , { stopCommand : stopCommand } ) ) ;
20- if ( stopCommand . toLowerCase ( ) == "^c" ) stopCommand = "\x03" ;
21- await instance . exec ( new SendCommand ( stopCommand ) ) ;
20+
21+ const stopCommandList = stopCommand . split ( "\n" ) ;
22+ for ( const stopCommandColumn of stopCommandList ) {
23+ if ( stopCommandColumn . toLocaleLowerCase ( ) == "^c" ) {
24+ await instance . exec ( new SendCommand ( "\x03" ) ) ;
25+ } else {
26+ await instance . exec ( new SendCommand ( stopCommandColumn ) ) ;
27+ }
28+ }
2229
2330 // If the instance is still in the stopped state after 10 minutes, restore the state
2431 const cacheStartCount = instance . startCount ;
You can’t perform that action at this time.
0 commit comments