More verbose conpty, winpty related error message#294193
Conversation
There was a problem hiding this comment.
Pull request overview
Improves the Windows terminal launch failure messaging by making the “Cannot launch conpty” native exception more actionable, pointing users to winpty removal context and a potential configuration workaround.
Changes:
- Adds a specialized localized error message for conpty launch failures in
TerminalProcess. - Adds a unit test covering formatting of the new conpty launch failure message in
parseExitResult.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/vs/platform/terminal/node/terminalProcess.ts | Detects “Cannot launch conpty” errors and returns a more informative localized launch error message. |
| src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts | Adds a regression test ensuring the conpty launch failure message is formatted as expected. |
| 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') }; |
There was a problem hiding this comment.
This localized conpty error message ends with a period and includes markdown-style backticks around the setting name. Because parseExitResult appends a trailing "." when formatting launch failures, this will produce a double period in the final message. Also, backticks are typically used in markdown contexts; for plain error messages it would be more consistent to use quotes (or no decoration) around the setting name.
| 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: 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') }; |
There was a problem hiding this comment.
Im not sure if this is better tbh
Resolves: #293524