Skip to content

VS Code is still adding /d /c to task commands #169821

@71

Description

@71

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.74.2
  • OS Version: Windows 11

Steps to Reproduce (on Windows):

  1. Have an npm task that starts a script.
  2. In the User Preferences, set "terminal.integrated.automationProfile.windows" as such:
    "terminal.integrated.automationProfile.windows": {
        "path": "nu.exe",
        "args": ["-c"],
    },
    This is an example; this also works with, e.g. pwsh.exe / ["-Command"].
  3. Run the task.
  4. VS Code will run nu.exe -c /d /c yarn run name rather than nu.exe -c "yarn run name".

This was marked as fixed in #93437, but it isn't. A workaround is given, but is IMO unacceptable. If I modify my shell in user settings, I shouldn't have to modify a tasks.json that many users will use, and whose preferred shells are different. More importantly, a single shell can be specified, so /bin/sh won't work for users on Windows, and cmd.exe / pwsh.exe / whatever won't work for users on Linux. This makes terminal.integrated.automationProfile.* essentially useless.

Since terminal.integrated.automationProfile.* takes an args argument, why add unwanted arguments to it? I understand why defaults may be nice (e.g. set args to ["-Command"] when path is pwsh.exe), but if preferences are explicitly specified, why append new arguments to them if they only work with a single shell?

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bugconfirmedIssue has been confirmed by VS Code Team membertasksTask system issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions