Skip to content

"Terminal process failed to launch" error message is inaccurate #307400

@CiaranWoodward

Description

@CiaranWoodward

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:

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.

Metadata

Metadata

Assignees

Labels

debtCode quality issuesterminal-processProblems launching processes, managing ptys, exiting, process leaks, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions