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) {
40
40
}
41
41
) ;
42
42
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
+ }
43
47
provider . webview ?. webview . postMessage ( { type : 'stdout' , value : data ?. toString ( ) } ) ;
44
48
} ) ;
45
49
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
+ }
46
54
provider . webview ?. webview . postMessage ( { type : 'stderr' , value : data ?. toString ( ) } ) ;
47
55
// TODO: Handle and highlight errors in the editor
48
56
} ) ;
@@ -53,7 +61,7 @@ export default function setupConsole(context: ExtensionContext) {
53
61
} ) ;
54
62
provider . webview ?. show ?.( true ) ;
55
63
provider . webview ?. webview . postMessage ( { type : 'clear' } ) ;
56
- sketchProcesses . push ( proc ) ;
64
+ sketchProcesses . unshift ( proc ) ;
57
65
commands . executeCommand ( 'setContext' , 'processing.sketch.running' , true ) ;
58
66
} ) ;
59
67
You can’t perform that action at this time.
0 commit comments