Do not force new window when opening file or folder with launch on Unity (fixes #21133)

This commit is contained in:
Christof Marti 2017-02-23 10:30:52 -08:00
parent a75e535fb7
commit fc92ea41fd
5 changed files with 8 additions and 5 deletions

View file

@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/@@NAME@@/@@NAME@@ --new-window-if-not-first %U
Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %U
Icon=@@NAME@@
Type=Application
StartupNotify=true

View file

@ -95,7 +95,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'] || args['new-window-if-not-first'])) {
} else if (args._.length === 0 && (args['new-window'] || args['unity-launch'])) {
usedWindows = this.windowsService.open({ context, cli: args, userEnv, forceNewWindow: true, forceEmpty: true });
} else if (args._.length === 0) {
usedWindows = [this.windowsService.focusLastActive(args, context)];

View file

@ -259,7 +259,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
} else if (global.macOpenFiles && global.macOpenFiles.length && (!environmentService.args._ || !environmentService.args._.length)) {
windowsMainService.open({ context: OpenContext.DOCK, cli: environmentService.args, pathsToOpen: global.macOpenFiles, initialStartup: true }); // mac: open-file event received on startup
} else {
windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'] || environmentService.args['new-window-if-not-first'], diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
windowsMainService.open({ context, cli: environmentService.args, forceNewWindow: environmentService.args['new-window'] || (!environmentService.args._.length && environmentService.args['unity-launch']), diffMode: environmentService.args.diff, initialStartup: true }); // default: read paths from cli
}
// Install Menu

View file

@ -14,7 +14,10 @@ export interface ParsedArgs {
diff?: boolean;
goto?: boolean;
'new-window'?: boolean;
'new-window-if-not-first'?: boolean;
/**
* Always open a new window, except if opening the first window or opening a file or folder as part of the launch.
*/
'unity-launch'?: boolean;
'reuse-window'?: boolean;
locale?: string;
'user-data-dir'?: string;

View file

@ -31,7 +31,7 @@ const options: minimist.Opts = {
'diff',
'goto',
'new-window',
'new-window-if-not-first',
'unity-launch',
'reuse-window',
'performance',
'verbose',