Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipc - drop --vscode- exec arguments before trying to spawn node.js #174852

Merged
merged 1 commit into from Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/vs/base/parts/ipc/node/ipc.cp.ts
Expand Up @@ -195,9 +195,9 @@ export class Client implements IChannelClient, IDisposable {
}

if (forkOpts.execArgv === undefined) {
// if not set, the forked process inherits the execArgv of the parent process
// --inspect and --inspect-brk can not be inherited as the port would conflict
forkOpts.execArgv = process.execArgv.filter(a => !/^--inspect(-brk)?=/.test(a)); // remove
forkOpts.execArgv = process.execArgv // if not set, the forked process inherits the execArgv of the parent process
.filter(a => !/^--inspect(-brk)?=/.test(a)) // --inspect and --inspect-brk can not be inherited as the port would conflict
.filter(a => !a.startsWith('--vscode-')); // --vscode-* arguments are unsupported by node.js and thus need to remove
}

removeDangerousEnvVariables(forkOpts.env);
Expand Down
5 changes: 1 addition & 4 deletions src/vs/platform/terminal/node/ptyHostService.ts
Expand Up @@ -77,9 +77,6 @@ export class PtyHostService extends Disposable implements IPtyService {
private readonly _onProcessExit = this._register(new Emitter<{ id: number; event: number | undefined }>());
readonly onProcessExit = this._onProcessExit.event;

// TODO@bpasero investigate why this is needed
private readonly forceEnableDebugInspect = this._environmentService.isBuilt && this._configurationService.getValue<boolean>('window.experimental.sharedProcessUseUtilityProcess');

constructor(
private readonly _reconnectConstants: IReconnectConstants,
private readonly loggerName: string,
Expand Down Expand Up @@ -152,7 +149,7 @@ export class PtyHostService extends Disposable implements IPtyService {
}
};

const ptyHostDebug = parsePtyHostDebugPort(this._environmentService.args, this.forceEnableDebugInspect ? false : this._environmentService.isBuilt);
const ptyHostDebug = parsePtyHostDebugPort(this._environmentService.args, this._environmentService.isBuilt);
if (ptyHostDebug) {
if (ptyHostDebug.break && ptyHostDebug.port) {
opts.debugBrk = ptyHostDebug.port;
Expand Down