File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -272,23 +272,22 @@ if (process.platform !== 'win32') {
272272 ptyProcess.on('data', function (data) {
273273 if (ptyProcess.process === 'Python') {
274274 console.log('title', ptyProcess.process);
275+ console.log('ready', ptyProcess.pid);
275276 }
276277 });
277- setTimeout(() => null, 500);
278- console.log('ready', ptyProcess.pid);
279278 ` ;
280279 const p = cp . spawn ( 'node' , [ '-e' , data ] ) ;
281280 let sub = '' ;
282281 let pid = '' ;
283282 p . stdout . on ( 'data' , ( data ) => {
284283 if ( ! data . toString ( ) . indexOf ( 'title' ) ) {
285284 sub = data . toString ( ) . split ( ' ' ) [ 1 ] . slice ( 0 , - 1 ) ;
285+ } else if ( ! data . toString ( ) . indexOf ( 'ready' ) ) {
286+ pid = data . toString ( ) . split ( ' ' ) [ 1 ] . slice ( 0 , - 1 ) ;
286287 setTimeout ( ( ) => {
287288 process . kill ( parseInt ( pid ) , 'SIGINT' ) ;
288289 p . kill ( 'SIGINT' ) ;
289290 } , 200 ) ;
290- } else if ( ! data . toString ( ) . indexOf ( 'ready' ) ) {
291- pid = data . toString ( ) . split ( ' ' ) [ 1 ] . slice ( 0 , - 1 ) ;
292291 }
293292 } ) ;
294293 p . on ( 'exit' , ( ) => {
You can’t perform that action at this time.
0 commit comments