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

sandbox - force enable pty inspect when using utility process #174834

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
4 changes: 2 additions & 2 deletions src/vs/platform/environment/common/environmentService.ts
Expand Up @@ -278,8 +278,8 @@ export abstract class AbstractNativeEnvironmentService implements INativeEnviron
) { }
}

export function parseExtensionHostDebugPort(args: NativeParsedArgs, isBuild: boolean): IExtensionHostDebugParams {
return parseDebugParams(args['inspect-extensions'], args['inspect-brk-extensions'], 5870, isBuild, args.debugId, args.extensionEnvironment);
export function parseExtensionHostDebugPort(args: NativeParsedArgs, isBuilt: boolean): IExtensionHostDebugParams {
return parseDebugParams(args['inspect-extensions'], args['inspect-brk-extensions'], 5870, isBuilt, args.debugId, args.extensionEnvironment);
}

export function parseDebugParams(debugArg: string | undefined, debugBrkArg: string | undefined, defaultBuildPort: number, isBuilt: boolean, debugId?: string, environmentString?: string): IExtensionHostDebugParams {
Expand Down
8 changes: 4 additions & 4 deletions src/vs/platform/environment/node/environmentService.ts
Expand Up @@ -21,10 +21,10 @@ export class NativeEnvironmentService extends AbstractNativeEnvironmentService {
}
}

export function parsePtyHostDebugPort(args: NativeParsedArgs, isBuild: boolean): IDebugParams {
return parseDebugParams(args['inspect-ptyhost'], args['inspect-brk-ptyhost'], 5877, isBuild, args.extensionEnvironment);
export function parsePtyHostDebugPort(args: NativeParsedArgs, isBuilt: boolean): IDebugParams {
return parseDebugParams(args['inspect-ptyhost'], args['inspect-brk-ptyhost'], 5877, isBuilt, args.extensionEnvironment);
}

export function parseSharedProcessDebugPort(args: NativeParsedArgs, isBuild: boolean): IDebugParams {
return parseDebugParams(args['inspect-sharedprocess'], args['inspect-brk-sharedprocess'], 5879, isBuild, args.extensionEnvironment);
export function parseSharedProcessDebugPort(args: NativeParsedArgs, isBuilt: boolean): IDebugParams {
return parseDebugParams(args['inspect-sharedprocess'], args['inspect-brk-sharedprocess'], 5879, isBuilt, args.extensionEnvironment);
}
5 changes: 4 additions & 1 deletion src/vs/platform/terminal/node/ptyHostService.ts
Expand Up @@ -77,6 +77,9 @@ 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 @@ -149,7 +152,7 @@ export class PtyHostService extends Disposable implements IPtyService {
}
};

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