Skip to content

Commit 29bee00

Browse files
authored
Fix debugger attach to process when running on WSL (#20741)
Possible fix for #16921 Closes #16921 BTW you folks should probably ask GitHub support to eject this repo from their original repository (so it stops being a fork and has its own network on GH)
1 parent e9dba6c commit 29bee00

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/client/common/process/rawProcessApis.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { noop } from '../utils/misc';
1313
import { decodeBuffer } from './decoder';
1414
import { traceVerbose } from '../../logging';
1515

16+
const PS_ERROR_SCREEN_BOGUS = /your [0-9]+x[0-9]+ screen size is bogus\. expect trouble/;
17+
1618
function getDefaultOptions<T extends ShellOptions | SpawnOptions>(options: T, defaultEnv?: EnvironmentVariables): T {
1719
const defaultOptions = { ...options };
1820
const execOptions = defaultOptions as SpawnOptions;
@@ -136,7 +138,13 @@ export function plainExec(
136138
}
137139
const stderr: string | undefined =
138140
stderrBuffers.length === 0 ? undefined : decodeBuffer(stderrBuffers, encoding);
139-
if (stderr && stderr.length > 0 && options.throwOnStdErr) {
141+
if (
142+
stderr &&
143+
stderr.length > 0 &&
144+
options.throwOnStdErr &&
145+
// ignore this specific error silently; see this issue for context: https://github.com/microsoft/vscode/issues/75932
146+
!(PS_ERROR_SCREEN_BOGUS.test(stderr) && stderr.replace(PS_ERROR_SCREEN_BOGUS, '').trim().length === 0)
147+
) {
140148
deferred.reject(new StdErrError(stderr));
141149
} else {
142150
let stdout = decodeBuffer(stdoutBuffers, encoding);

0 commit comments

Comments
 (0)