diff --git a/src/vs/base/parts/ipc/node/ipc.cp.ts b/src/vs/base/parts/ipc/node/ipc.cp.ts index 940c18638fba3f63cbf3cdcc6ec6be93bb63ac41..21b1b3f5531270d963cb3f7aeab825d65d201eec 100644 --- a/src/vs/base/parts/ipc/node/ipc.cp.ts +++ b/src/vs/base/parts/ipc/node/ipc.cp.ts @@ -56,6 +56,14 @@ export interface IIPCOptions { */ debugBrk?: number; + /** + * See https://github.com/Microsoft/vscode/issues/27665 + * Allows to pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + * e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + * results in the forked process inheriting `--debug-brk=xxx`. + */ + freshExecArgv?: boolean; + /** * Enables our createQueuedSender helper for this Client. Uses a queue when the internal Node.js queue is * full of messages - see notes on that method. @@ -125,6 +133,10 @@ export class Client implements IChannelClient, IDisposable { forkOpts.env = assign(forkOpts.env, this.options.env); } + if (this.options && this.options.freshExecArgv) { + forkOpts.execArgv = []; + } + if (this.options && typeof this.options.debug === 'number') { forkOpts.execArgv = ['--nolazy', '--debug=' + this.options.debug]; } diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 1c2d62c29d14c84a250a9664f575b13a375742e8..ac68c6c4e285f3b5b8d6cd670feab4ae25afa87e 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -207,6 +207,11 @@ export class DiskSearch { serverName: 'Search', timeout: timeout, args: ['--type=searchService'], + // See https://github.com/Microsoft/vscode/issues/27665 + // Pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. + // e.g. Launching the extension host process with `--debug-brk=xxx` and then forking a process from the extension host + // results in the forked process inheriting `--debug-brk=xxx`. + freshExecArgv: true, env: { AMD_ENTRYPOINT: 'vs/workbench/services/search/node/searchApp', PIPE_LOGGING: 'true',