From 348c77dcb65625066b0a521bd3a9e2bde455d1b6 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 3 Feb 2017 10:56:44 -0800 Subject: [PATCH] Fix --new-window-if-not-first The setting will now correctly open a new window when no file is specified, but if a file is specified it will reuse. This is so opening via the file manager will reuse the window. Fixes #19775 --- src/vs/code/electron-main/launch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/code/electron-main/launch.ts b/src/vs/code/electron-main/launch.ts index 6c7ae73147a..77a863d1bb6 100644 --- a/src/vs/code/electron-main/launch.ts +++ b/src/vs/code/electron-main/launch.ts @@ -94,7 +94,7 @@ export class LaunchService implements ILaunchService { let usedWindows: VSCodeWindow[]; if (!!args.extensionDevelopmentPath) { this.windowsService.openExtensionDevelopmentHostWindow({ context, cli: args, userEnv }); - } else if (args._.length === 0 && args['new-window']) { + } else if (args._.length === 0 && (args['new-window'] || args['new-window-if-not-first'])) { usedWindows = this.windowsService.open({ context, cli: args, userEnv, forceNewWindow: true, forceEmpty: true }); } else if (args._.length === 0) { usedWindows = [this.windowsService.focusLastActive(args, context)]; @@ -103,7 +103,7 @@ export class LaunchService implements ILaunchService { context, cli: args, userEnv, - forceNewWindow: args.wait || args['new-window'] || args['new-window-if-not-first'], + forceNewWindow: args.wait || args['new-window'], preferNewWindow: !args['reuse-window'], forceReuseWindow: args['reuse-window'], diffMode: args.diff -- GitLab