From c2a2625e1b6c863e619e8d31b4098f9c7b1b652c Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Tue, 13 Jul 2021 14:42:24 -0700 Subject: [PATCH] fix: parsing of no-sandbox flag Fixes https://github.com/microsoft/vscode/issues/128279 --- src/vs/platform/environment/common/argv.ts | 1 + src/vs/platform/environment/node/argv.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/vs/platform/environment/common/argv.ts b/src/vs/platform/environment/common/argv.ts index 8420a50ebb9..70a7eb4b86e 100644 --- a/src/vs/platform/environment/common/argv.ts +++ b/src/vs/platform/environment/common/argv.ts @@ -88,6 +88,7 @@ export interface NativeParsedArgs { // chromium command line args: https://electronjs.org/docs/all#supported-chrome-command-line-switches 'no-proxy-server'?: boolean; + 'no-sandbox'?: boolean; 'proxy-server'?: string; 'proxy-bypass-list'?: string; 'proxy-pac-url'?: string; diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index aafba8a6b3d..2715617e2bc 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -123,6 +123,12 @@ export const OPTIONS: OptionDescriptions> = { // chromium flags 'no-proxy-server': { type: 'boolean' }, + // Minimist incorrectly parses keys that start with `--no` + // https://github.com/substack/minimist/blob/aeb3e27dae0412de5c0494e9563a5f10c82cc7a9/index.js#L118-L121 + // If --no-sandbox is passed via cli wrapper it will be treated as --sandbox which is incorrect, we use + // the alias here to make sure --no-sandbox is always respected. + // For https://github.com/microsoft/vscode/issues/128279 + 'no-sandbox': { type: 'boolean', alias: 'sandbox' }, 'proxy-server': { type: 'string' }, 'proxy-bypass-list': { type: 'string' }, 'proxy-pac-url': { type: 'string' }, -- GitLab