File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,17 @@ export default function setupConsole(context: ExtensionContext) {
4040 }
4141 ) ;
4242 proc . stdout . on ( "data" , ( data ) => {
43+ if ( proc != sketchProcesses [ 0 ] ) {
44+ // If this is not the most recent process, ignore its output
45+ return ;
46+ }
4347 provider . webview ?. webview . postMessage ( { type : 'stdout' , value : data ?. toString ( ) } ) ;
4448 } ) ;
4549 proc . stderr . on ( "data" , ( data ) => {
50+ if ( proc != sketchProcesses [ 0 ] ) {
51+ // If this is not the most recent process, ignore its output
52+ return ;
53+ }
4654 provider . webview ?. webview . postMessage ( { type : 'stderr' , value : data ?. toString ( ) } ) ;
4755 // TODO: Handle and highlight errors in the editor
4856 } ) ;
@@ -53,7 +61,7 @@ export default function setupConsole(context: ExtensionContext) {
5361 } ) ;
5462 provider . webview ?. show ?.( true ) ;
5563 provider . webview ?. webview . postMessage ( { type : 'clear' } ) ;
56- sketchProcesses . push ( proc ) ;
64+ sketchProcesses . unshift ( proc ) ;
5765 commands . executeCommand ( 'setContext' , 'processing.sketch.running' , true ) ;
5866 } ) ;
5967
You can’t perform that action at this time.
0 commit comments