mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
More verbose conpty, winpty related error message (#294193)
This commit is contained in:
@@ -244,7 +244,11 @@ export class TerminalProcess extends Disposable implements ITerminalChildProcess
|
||||
return undefined;
|
||||
} catch (err) {
|
||||
this._logService.trace('node-pty.node-pty.IPty#spawn native exception', err);
|
||||
return { message: `A native exception occurred during launch (${err.message})` };
|
||||
const errorMessage = err.message;
|
||||
if (errorMessage?.includes('Cannot launch conpty')) {
|
||||
return { message: localize('conptyLaunchFailed', "A native exception occurred during launch (Cannot launch conpty). Winpty has been removed, see {0} for more details. You can also try enabling the `{1}` setting.", 'https://code.visualstudio.com/updates/v1_109#_removal-of-winpty-support', 'terminal.integrated.windowsUseConptyDll') };
|
||||
}
|
||||
return { message: `A native exception occurred during launch (${errorMessage})` };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -288,6 +288,12 @@ suite('Workbench - TerminalInstance', () => {
|
||||
{ code: 1260, message: `The terminal process failed to launch: Windows cannot open this program because it has been prevented by a software restriction policy. For more information, open Event Viewer or contact your system Administrator.` }
|
||||
);
|
||||
});
|
||||
test('should format conpty launch failure', () => {
|
||||
deepStrictEqual(
|
||||
parseExitResult({ message: 'A native exception occurred during launch (Cannot launch conpty). Winpty has been removed, see https://code.visualstudio.com/updates/v1_109#_removal-of-winpty-support for more details. You can also try enabling the `terminal.integrated.windowsUseConptyDll` setting.' }, {}, ProcessState.KilledDuringLaunch, undefined),
|
||||
{ code: undefined, message: `The terminal process failed to launch: A native exception occurred during launch (Cannot launch conpty). Winpty has been removed, see https://code.visualstudio.com/updates/v1_109#_removal-of-winpty-support for more details. You can also try enabling the \`terminal.integrated.windowsUseConptyDll\` setting..` }
|
||||
);
|
||||
});
|
||||
test('should format generic failures', () => {
|
||||
deepStrictEqual(
|
||||
parseExitResult({ code: 123, message: 'A native exception occurred during launch (Cannot create process, error code: 123)' }, {}, ProcessState.KilledDuringLaunch, undefined),
|
||||
|
||||
Reference in New Issue
Block a user