Skip to content

Commit 04c5aa4

Browse files
authored
Support only Big Sur, fixes microsoft#134023 (microsoft#134071)
1 parent c03da8b commit 04c5aa4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/vs/code/node/cli.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import { ChildProcess, spawn, SpawnOptions } from 'child_process';
77
import { chmodSync, existsSync, readFileSync, statSync, truncateSync, unlinkSync } from 'fs';
8-
import { homedir, tmpdir } from 'os';
8+
import { homedir, release, tmpdir } from 'os';
99
import type { ProfilingSession, Target } from 'v8-inspect-profiler';
1010
import { Event } from 'vs/base/common/event';
1111
import { isAbsolute, join, resolve } from 'vs/base/common/path';
@@ -195,6 +195,8 @@ export async function main(argv: string[]): Promise<any> {
195195
}
196196
}
197197

198+
const isBigSur = isMacintosh && release() > '20.0.0';
199+
198200
// If we are started with --wait create a random temporary file
199201
// and pass it over to the starting instance. We can use this file
200202
// 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> {
212214
// - the launched process terminates (e.g. due to a crash)
213215
processCallbacks.push(async child => {
214216
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,
217219
// i.e. the open command, exited with a signal or error. Otherwise, we
218220
// wait for the marker file to be deleted or for the child to error.
219221
childExitPromise = new Promise<void>((resolve) => {
@@ -363,11 +365,11 @@ export async function main(argv: string[]): Promise<any> {
363365
}
364366

365367
let child: ChildProcess;
366-
if (!isMacintosh) {
368+
if (!isBigSur) {
367369
// We spawn process.execPath directly
368370
child = spawn(process.execPath, argv.slice(2), options);
369371
} 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
371373
// similar to if the app was launched from the dock
372374
// https://github.com/microsoft/vscode/issues/102975
373375

0 commit comments

Comments
 (0)