Skip to content

Commit 940f3fe

Browse files
fix debugger attach to process when running on WSL
Co-authored-by: David Archibald <[email protected]>
1 parent ca82fb7 commit 940f3fe

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/extension/common/process/rawProcessApis.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { ExecutionResult, ShellOptions, SpawnOptions, StdErrError } from './type
1111
import { noop } from '../utils/misc';
1212
import { decodeBuffer } from './decoder';
1313

14+
const PS_ERROR_SCREEN_BOGUS = /your [0-9]+x[0-9]+ screen size is bogus\. expect trouble/;
15+
1416
function getDefaultOptions<T extends ShellOptions | SpawnOptions>(options: T, defaultEnv?: EnvironmentVariables): T {
1517
const defaultOptions = { ...options };
1618
const execOptions = defaultOptions as SpawnOptions;
@@ -98,7 +100,13 @@ export function plainExec(
98100
}
99101
const stderr: string | undefined =
100102
stderrBuffers.length === 0 ? undefined : decodeBuffer(stderrBuffers, encoding);
101-
if (stderr && stderr.length > 0 && options.throwOnStdErr) {
103+
if (
104+
stderr &&
105+
stderr.length > 0 &&
106+
options.throwOnStdErr &&
107+
// ignore this specific error silently; see this issue for context: https://github.com/microsoft/vscode/issues/75932
108+
!(PS_ERROR_SCREEN_BOGUS.test(stderr) && stderr.replace(PS_ERROR_SCREEN_BOGUS, '').trim().length === 0)
109+
) {
102110
deferred.reject(new StdErrError(stderr));
103111
} else {
104112
let stdout = decodeBuffer(stdoutBuffers, encoding);

0 commit comments

Comments
 (0)