mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
parent
d4f1c39dc0
commit
ab10e26096
|
@ -217,7 +217,7 @@ function prepareSnapPackage(arch) {
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@EXEC@@', product.applicationName))
|
.pipe(replace('@@EXEC@@', `${product.applicationName} --force-user-env`))
|
||||||
.pipe(replace('@@ICON@@', `\${SNAP}/meta/gui/${product.linuxIconName}.png`))
|
.pipe(replace('@@ICON@@', `\${SNAP}/meta/gui/${product.linuxIconName}.png`))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
|
|
|
@ -49,14 +49,14 @@ parts:
|
||||||
|
|
||||||
apps:
|
apps:
|
||||||
@@NAME@@:
|
@@NAME@@:
|
||||||
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@
|
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@
|
||||||
common-id: @@NAME@@.desktop
|
common-id: @@NAME@@.desktop
|
||||||
environment:
|
environment:
|
||||||
DISABLE_WAYLAND: 1
|
DISABLE_WAYLAND: 1
|
||||||
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
||||||
|
|
||||||
url-handler:
|
url-handler:
|
||||||
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@ --open-url
|
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@ --open-url
|
||||||
environment:
|
environment:
|
||||||
DISABLE_WAYLAND: 1
|
DISABLE_WAYLAND: 1
|
||||||
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import { spawn, ChildProcess, SpawnOptions } from 'child_process';
|
import { spawn, ChildProcess, SpawnOptions } from 'child_process';
|
||||||
import { assign } from 'vs/base/common/objects';
|
|
||||||
import { buildHelpMessage, buildVersionMessage, addArg, createWaitMarkerFile, OPTIONS } from 'vs/platform/environment/node/argv';
|
import { buildHelpMessage, buildVersionMessage, addArg, createWaitMarkerFile, OPTIONS } from 'vs/platform/environment/node/argv';
|
||||||
import { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
import { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
|
||||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||||
|
@ -118,10 +117,15 @@ export async function main(argv: string[]): Promise<any> {
|
||||||
|
|
||||||
// Just Code
|
// Just Code
|
||||||
else {
|
else {
|
||||||
const env = assign({}, process.env, {
|
const env: NodeJS.ProcessEnv = {
|
||||||
|
...process.env,
|
||||||
'VSCODE_CLI': '1', // this will signal Code that it was spawned from this module
|
'VSCODE_CLI': '1', // this will signal Code that it was spawned from this module
|
||||||
'ELECTRON_NO_ATTACH_CONSOLE': '1'
|
'ELECTRON_NO_ATTACH_CONSOLE': '1'
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (args['force-user-env']) {
|
||||||
|
env['VSCODE_FORCE_USER_ENV'] = '1';
|
||||||
|
}
|
||||||
|
|
||||||
delete env['ELECTRON_RUN_AS_NODE'];
|
delete env['ELECTRON_RUN_AS_NODE'];
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ export function getShellEnvironment(logService: ILogService, environmentService:
|
||||||
} else if (isWindows) {
|
} else if (isWindows) {
|
||||||
logService.trace('getShellEnvironment: running on Windows, skipping');
|
logService.trace('getShellEnvironment: running on Windows, skipping');
|
||||||
_shellEnv = Promise.resolve({});
|
_shellEnv = Promise.resolve({});
|
||||||
} else if (process.env['VSCODE_CLI'] === '1') {
|
} else if (process.env['VSCODE_CLI'] === '1' && process.env['VSCODE_FORCE_USER_ENV'] !== '1') {
|
||||||
logService.trace('getShellEnvironment: running on CLI, skipping');
|
logService.trace('getShellEnvironment: running on CLI, skipping');
|
||||||
_shellEnv = Promise.resolve({});
|
_shellEnv = Promise.resolve({});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -73,6 +73,7 @@ export interface ParsedArgs {
|
||||||
'disable-user-env-probe'?: boolean;
|
'disable-user-env-probe'?: boolean;
|
||||||
'disable-inspect'?: boolean;
|
'disable-inspect'?: boolean;
|
||||||
'force'?: boolean;
|
'force'?: boolean;
|
||||||
|
'force-user-env'?: boolean;
|
||||||
|
|
||||||
// node flags
|
// node flags
|
||||||
'js-flags'?: string;
|
'js-flags'?: string;
|
||||||
|
|
|
@ -110,6 +110,7 @@ export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
|
||||||
'trace-category-filter': { type: 'string' },
|
'trace-category-filter': { type: 'string' },
|
||||||
'trace-options': { type: 'string' },
|
'trace-options': { type: 'string' },
|
||||||
'disable-inspect': { type: 'boolean' },
|
'disable-inspect': { type: 'boolean' },
|
||||||
|
'force-user-env': { type: 'boolean' },
|
||||||
|
|
||||||
'js-flags': { type: 'string' }, // chrome js flags
|
'js-flags': { type: 'string' }, // chrome js flags
|
||||||
'nolazy': { type: 'boolean' }, // node inspect
|
'nolazy': { type: 'boolean' }, // node inspect
|
||||||
|
|
Loading…
Reference in a new issue