提交 68fe046a 编写于 作者: J Joao Moreno

fix shared process window startup

上级 09204bfb
...@@ -51,9 +51,6 @@ function main() { ...@@ -51,9 +51,6 @@ function main() {
const args = parseURLQueryArgs(); const args = parseURLQueryArgs();
const configuration = JSON.parse(args['config'] || '{}') || {}; const configuration = JSON.parse(args['config'] || '{}') || {};
// Correctly inherit the parent's environment
assign(process.env, configuration.userEnv);
// Get the nls configuration into the process.env as early as possible. // Get the nls configuration into the process.env as early as possible.
var nlsConfig = { availableLanguages: {} }; var nlsConfig = { availableLanguages: {} };
const config = process.env['VSCODE_NLS_CONFIG']; const config = process.env['VSCODE_NLS_CONFIG'];
...@@ -98,9 +95,7 @@ function main() { ...@@ -98,9 +95,7 @@ function main() {
}); });
} }
require(['vs/code/electron-browser/sharedProcessMain'], function () { require(['vs/code/electron-browser/sharedProcessMain'], function () { });
});
}); });
} }
......
...@@ -144,7 +144,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo ...@@ -144,7 +144,7 @@ function main(accessor: ServicesAccessor, mainIpcServer: Server, userEnv: platfo
// Spawn shared process // Spawn shared process
const initData = { args: environmentService.args }; const initData = { args: environmentService.args };
const sharedProcess = spawnSharedProcess(initData) const sharedProcess = spawnSharedProcess(initData, environmentService.appRoot, environmentService.nodeCachedDataDir)
.then(disposable => connect(environmentService.sharedIPCHandle, 'main')); .then(disposable => connect(environmentService.sharedIPCHandle, 'main'));
// Create a new service collection, because the telemetry service // Create a new service collection, because the telemetry service
......
...@@ -12,18 +12,14 @@ export interface ISharedProcessInitData { ...@@ -12,18 +12,14 @@ export interface ISharedProcessInitData {
args: ParsedArgs; args: ParsedArgs;
} }
export function spawnSharedProcess(initData: ISharedProcessInitData): TPromise<void> { export function spawnSharedProcess(initData: ISharedProcessInitData, appRoot: string, nodeCachedDataDir: string): TPromise<void> {
const window = new BrowserWindow(); const window = new BrowserWindow();
const config = assign({ const config = assign({ appRoot, nodeCachedDataDir });
userEnv: {},
appRoot: '',
nodeCachedDataDir: ''
});
const url = `${require.toUrl('vs/code/electron-browser/sharedProcess.html')}?config=${encodeURIComponent(JSON.stringify(config))}`; const url = `${require.toUrl('vs/code/electron-browser/sharedProcess.html')}?config=${encodeURIComponent(JSON.stringify(config))}`;
window.loadURL(url); window.loadURL(url);
// window.hide();
window.webContents.openDevTools(); window.webContents.openDevTools();
// window.hide();
// Prevent the window from dying // Prevent the window from dying
window.on('close', e => { window.on('close', e => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册