Skip to content

Commit 2a8dea3

Browse files
authored
code --status displays a lot of errors before actual status output (fix microsoft#183787) (microsoft#183915)
1 parent 2d131d2 commit 2a8dea3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/vs/code/electron-main/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ class CodeMain {
382382

383383
// Print --status usage info
384384
if (environmentMainService.args.status) {
385-
logService.warn('Warning: The --status argument can only be used if {0} is already running. Please run it again after {0} has started.', productService.nameShort);
385+
logService.warn(localize('statusWarning', "Warning: The --status argument can only be used if {0} is already running. Please run it again after {0} has started.", productService.nameShort));
386386

387387
throw new ExpectedError('Terminating...');
388388
}

src/vs/code/node/cli.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export async function main(argv: string[]): Promise<any> {
188188

189189
const processCallbacks: ((child: ChildProcess) => Promise<void>)[] = [];
190190

191-
const verbose = args.verbose || args.status;
191+
const verbose = args.verbose;
192192
if (verbose) {
193193
env['ELECTRON_ENABLE_LOGGING'] = '1';
194194

@@ -413,6 +413,9 @@ export async function main(argv: string[]): Promise<any> {
413413

414414
let child: ChildProcess;
415415
if (!isMacOSBigSurOrNewer) {
416+
if (!verbose && args.status) {
417+
options['stdio'] = 'pipe'; // restore ability to see output when --status is used
418+
}
416419
// We spawn process.execPath directly
417420
child = spawn(process.execPath, argv.slice(2), options);
418421
} else {
@@ -431,7 +434,7 @@ export async function main(argv: string[]): Promise<any> {
431434
// -a opens the given application.
432435
spawnArgs.push('-a', process.execPath); // -a: opens a specific application
433436

434-
if (verbose) {
437+
if (verbose || args.status) {
435438
spawnArgs.push('--wait-apps'); // `open --wait-apps`: blocks until the launched app is closed (even if they were already running)
436439

437440
// The open command only allows for redirecting stderr and stdout to files,

0 commit comments

Comments
 (0)