提交 29af544a 编写于 作者: D Daniel Imms 提交者: Joao Moreno

fix url handling in Windows

上级 97932359
......@@ -105,8 +105,7 @@ export class LaunchService implements ILaunchService {
this.logService.trace('Received data from other instance: ', args, userEnv);
// Check early for open-url which is handled in URL service
const openUrlArg = args['open-url'] || [];
const openUrl = typeof openUrlArg === 'string' ? [openUrlArg] : openUrlArg;
const openUrl = (args['open-url'] ? args._urls : []) || [];
if (openUrl.length > 0) {
openUrl.forEach(url => this.urlService.open(url));
......
......@@ -66,7 +66,7 @@ function createServices(args: ParsedArgs): IInstantiationService {
services.set(IStateService, new SyncDescriptor(StateService));
services.set(IConfigurationService, new SyncDescriptor(ConfigurationService));
services.set(IRequestService, new SyncDescriptor(RequestService));
services.set(IURLService, new SyncDescriptor(URLService, args['open-url']));
services.set(IURLService, new SyncDescriptor(URLService, args['open-url'] ? args._urls : []));
services.set(IBackupMainService, new SyncDescriptor(BackupMainService));
return new InstantiationService(services, true);
......
......@@ -15,6 +15,10 @@ import { ParsedArgs } from 'vs/platform/environment/common/environment';
import { realpathSync } from 'vs/base/node/extfs';
export function validatePaths(args: ParsedArgs): ParsedArgs {
// Track URLs if they're going to be used
if (args['open-url']) {
args._urls = args._;
}
// Realpath/normalize paths and watch out for goto line mode
const paths = doValidatePaths(args._, args.goto);
......
......@@ -9,6 +9,7 @@ import { LogLevel } from 'vs/platform/log/common/log';
export interface ParsedArgs {
[arg: string]: any;
_: string[];
_urls?: string[];
help?: boolean;
version?: boolean;
status?: boolean;
......@@ -42,7 +43,7 @@ export interface ParsedArgs {
'install-extension'?: string | string[];
'uninstall-extension'?: string | string[];
'enable-proposed-api'?: string | string[];
'open-url'?: string | string[];
'open-url'?: boolean;
'skip-getting-started'?: boolean;
'sticky-quickopen'?: boolean;
'disable-telemetry'?: boolean;
......
......@@ -26,7 +26,6 @@ const options: minimist.Opts = {
'debugBrkPluginHost',
'debugSearch',
'debugBrkSearch',
'open-url',
'enable-proposed-api',
'export-default-configuration',
'install-source'
......@@ -41,6 +40,7 @@ const options: minimist.Opts = {
'new-window',
'unity-launch',
'reuse-window',
'open-url',
'performance',
'prof-startup',
'verbose',
......
......@@ -25,7 +25,7 @@ export class URLService implements IURLService {
...globalBuffer
];
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url']);
app.setAsDefaultProtocolClient(product.urlProtocol, process.execPath, ['--open-url', '--']);
const rawOnOpenUrl = fromNodeEventEmitter(app, 'open-url', (event: Electron.Event, url: string) => ({ event, url }));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册