Skip to content

Commit f0ca34a

Browse files
authored
ipc - drop --vscode- exec arguments before trying to spawn node.js (microsoft#174852)
1 parent f15aa39 commit f0ca34a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/vs/base/parts/ipc/node/ipc.cp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,9 @@ export class Client implements IChannelClient, IDisposable {
195195
}
196196

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

203203
removeDangerousEnvVariables(forkOpts.env);

src/vs/platform/terminal/node/ptyHostService.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ export class PtyHostService extends Disposable implements IPtyService {
7777
private readonly _onProcessExit = this._register(new Emitter<{ id: number; event: number | undefined }>());
7878
readonly onProcessExit = this._onProcessExit.event;
7979

80-
// TODO@bpasero investigate why this is needed
81-
private readonly forceEnableDebugInspect = this._environmentService.isBuilt && this._configurationService.getValue<boolean>('window.experimental.sharedProcessUseUtilityProcess');
82-
8380
constructor(
8481
private readonly _reconnectConstants: IReconnectConstants,
8582
private readonly loggerName: string,
@@ -152,7 +149,7 @@ export class PtyHostService extends Disposable implements IPtyService {
152149
}
153150
};
154151

155-
const ptyHostDebug = parsePtyHostDebugPort(this._environmentService.args, this.forceEnableDebugInspect ? false : this._environmentService.isBuilt);
152+
const ptyHostDebug = parsePtyHostDebugPort(this._environmentService.args, this._environmentService.isBuilt);
156153
if (ptyHostDebug) {
157154
if (ptyHostDebug.break && ptyHostDebug.port) {
158155
opts.debugBrk = ptyHostDebug.port;

0 commit comments

Comments
 (0)