This commit is contained in:
João Moreno 2019-09-11 13:31:42 +02:00 committed by GitHub
parent d4f1c39dc0
commit ab10e26096
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 7 deletions

View File

@ -217,7 +217,7 @@ function prepareSnapPackage(arch) {
.pipe(replace('@@NAME_LONG@@', product.nameLong))
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.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('@@URLPROTOCOL@@', product.urlProtocol));

View File

@ -49,14 +49,14 @@ parts:
apps:
@@NAME@@:
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@
common-id: @@NAME@@.desktop
environment:
DISABLE_WAYLAND: 1
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas
url-handler:
command: electron-launch $SNAP/usr/share/@@NAME@@/@@NAME@@ --open-url
command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@ --open-url
environment:
DISABLE_WAYLAND: 1
GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas

View File

@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
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 { parseCLIProcessArgv } from 'vs/platform/environment/node/argvHelper';
import { ParsedArgs } from 'vs/platform/environment/common/environment';
@ -118,10 +117,15 @@ export async function main(argv: string[]): Promise<any> {
// Just Code
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
'ELECTRON_NO_ATTACH_CONSOLE': '1'
});
};
if (args['force-user-env']) {
env['VSCODE_FORCE_USER_ENV'] = '1';
}
delete env['ELECTRON_RUN_AS_NODE'];

View File

@ -98,7 +98,7 @@ export function getShellEnvironment(logService: ILogService, environmentService:
} else if (isWindows) {
logService.trace('getShellEnvironment: running on Windows, skipping');
_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');
_shellEnv = Promise.resolve({});
} else {

View File

@ -73,6 +73,7 @@ export interface ParsedArgs {
'disable-user-env-probe'?: boolean;
'disable-inspect'?: boolean;
'force'?: boolean;
'force-user-env'?: boolean;
// node flags
'js-flags'?: string;

View File

@ -110,6 +110,7 @@ export const OPTIONS: OptionDescriptions<Required<ParsedArgs>> = {
'trace-category-filter': { type: 'string' },
'trace-options': { type: 'string' },
'disable-inspect': { type: 'boolean' },
'force-user-env': { type: 'boolean' },
'js-flags': { type: 'string' }, // chrome js flags
'nolazy': { type: 'boolean' }, // node inspect