Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.114.0
- OS Version: Darwin Arm64 25.1.0
On very fast systems, when a task fails, vs code can print the error:
The terminal process failed to launch (exit code: 2)
Rather than the usual, clearer:
The terminal process terminated with exit code: 2
The exact wording of the message seems to be chosen here:
|
message = nls.localize('launchFailed.exitCodeAndCommandLine', "The terminal process \"{0}\" failed to launch (exit code: {1}).", commandLine, code); |
and is based on an arbitrary 500ms timeout defined here:
|
ErrorLaunchThresholdDuration = 500, |
But in my test case, running a script task which completes very quickly (but this also occurs with other non-script tasks), will print the "failed to launch" error, even when the issue is totally unrelated to the launch.
e.g, if I have an error in my C source code and run this task:
{
"label": "This appears to fail to launch on fast systems",
"type": "shell",
"command": "cd build && make",
}
The "failed to launch" error is the one that is displayed, despite the fact that there is no issue with the task itself or the shell syntax - the issue is in the source code of what I am attempting to build.
Does this issue occur when all extensions are disabled?: Yes
On very fast systems, when a task fails, vs code can print the error:
Rather than the usual, clearer:
The exact wording of the message seems to be chosen here:
vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts
Line 2768 in 7310bf3
and is based on an arbitrary 500ms timeout defined here:
vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.ts
Line 54 in 7310bf3
But in my test case, running a script task which completes very quickly (but this also occurs with other non-script tasks), will print the "failed to launch" error, even when the issue is totally unrelated to the launch.
e.g, if I have an error in my C source code and run this task:
The "failed to launch" error is the one that is displayed, despite the fact that there is no issue with the task itself or the shell syntax - the issue is in the source code of what I am attempting to build.