mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 04:49:35 +00:00
Do not force new window when opening file or folder with launch on Unity (fixes #21133)
This commit is contained in:
parent
a75e535fb7
commit
fc92ea41fd
|
@ -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
|
||||
|
|
|
@ -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)];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -31,7 +31,7 @@ const options: minimist.Opts = {
|
|||
'diff',
|
||||
'goto',
|
||||
'new-window',
|
||||
'new-window-if-not-first',
|
||||
'unity-launch',
|
||||
'reuse-window',
|
||||
'performance',
|
||||
'verbose',
|
||||
|
|
Loading…
Reference in a new issue