Skip to content

VSCode adding /d and /c arguments to task command on execution? #93437

@roozmahdavian

Description

@roozmahdavian

I've configured the latest release of VSCode for SSH remote development from a local macOS machine to a remote Windows 10 machine. A task is configured to build an example C++ program:

{
    "version": "2.0.0",
    "tasks": [
      {
        "type": "shell",
        "label": "gcc",
        "command": "g++",
        "args": [
          "-g", 
          "${file}", 
          "-o", "${fileDirname}\\build\\${fileBasenameNoExtension}.exe"
        ],
        "problemMatcher": ["$gcc"],
        "group": {
          "kind": "build",
          "isDefault": true
        }
      }
    ]

For whatever reason, executing this task in any shell other than cmd.exe causes "/d /c" to be prefixed to the command, which obviously breaks the build in that shell. Why is this happening? How do I disable it? I haven't touched any of the default VSCode settings and I haven't modified cpp_properties.json, and I can't find any other reports of this behavior.

`> Executing task: g++ -g c:\Users\home\dev\helloworld.cpp -o c:\Users\ home\dev\build\helloworld.exe <

/d : The term '/d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • /d /c g++ -g c:\Users\home\dev\helloworld.cpp -o c:\Users\home ...
  • ~~
    • CategoryInfo : ObjectNotFound: (/d:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException`

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorbugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsidersremoteRemote system operations issuestasksTask system issuesverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions