5
5
6
6
import { ChildProcess , spawn , SpawnOptions } from 'child_process' ;
7
7
import { chmodSync , existsSync , readFileSync , statSync , truncateSync , unlinkSync } from 'fs' ;
8
- import { homedir , tmpdir } from 'os' ;
8
+ import { homedir , release , tmpdir } from 'os' ;
9
9
import type { ProfilingSession , Target } from 'v8-inspect-profiler' ;
10
10
import { Event } from 'vs/base/common/event' ;
11
11
import { isAbsolute , join , resolve } from 'vs/base/common/path' ;
@@ -195,6 +195,8 @@ export async function main(argv: string[]): Promise<any> {
195
195
}
196
196
}
197
197
198
+ const isBigSur = isMacintosh && release ( ) > '20.0.0' ;
199
+
198
200
// If we are started with --wait create a random temporary file
199
201
// and pass it over to the starting instance. We can use this file
200
202
// to wait for it to be deleted to monitor that the edited file
@@ -212,8 +214,8 @@ export async function main(argv: string[]): Promise<any> {
212
214
// - the launched process terminates (e.g. due to a crash)
213
215
processCallbacks . push ( async child => {
214
216
let childExitPromise ;
215
- if ( isMacintosh ) {
216
- // On macOS , we resolve the following promise only when the child,
217
+ if ( isBigSur ) {
218
+ // On Big Sur , we resolve the following promise only when the child,
217
219
// i.e. the open command, exited with a signal or error. Otherwise, we
218
220
// wait for the marker file to be deleted or for the child to error.
219
221
childExitPromise = new Promise < void > ( ( resolve ) => {
@@ -363,11 +365,11 @@ export async function main(argv: string[]): Promise<any> {
363
365
}
364
366
365
367
let child : ChildProcess ;
366
- if ( ! isMacintosh ) {
368
+ if ( ! isBigSur ) {
367
369
// We spawn process.execPath directly
368
370
child = spawn ( process . execPath , argv . slice ( 2 ) , options ) ;
369
371
} else {
370
- // On mac , we spawn using the open command to obtain behavior
372
+ // On Big Sur , we spawn using the open command to obtain behavior
371
373
// similar to if the app was launched from the dock
372
374
// https://github.com/microsoft/vscode/issues/102975
373
375
0 commit comments