Skip to content

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

Closed
@71

Description

@71
Contributor

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?

Activity

added
bugIssue identified by VS Code Team member as probable bug
tasksTask system issues
on Jan 6, 2023
added this to the Backlog milestone on Jan 6, 2023
hptechdesign

hptechdesign commented on Mar 17, 2023

@hptechdesign

I'm running into this today, version 1.76.2 while trying to execute a shell script:

The terminal process "C:\msys64\msys2_shell.cmd -defterm -here -no-start -mingw64 /d /c .TransferBuild.sh" terminated with exit code: 127.

hackpascal

hackpascal commented on Apr 27, 2023

@hackpascal

I'm using Makefile Tools with MSYS2 build environment and the same bug occurs:
vscode version 1.77.3

settings.json:

	"terminal.integrated.automationProfile.windows": {
		"path": "E:\\msys64\\msys2_shell.cmd",
		"args": ["-msys2", "-defterm", "-no-start", "-where", "${workspaceFolder}"],
	},
	"terminal.integrated.defaultProfile.windows": "MSYS2",
  *  Executing task: 'make.exe' 'all' 
  
  /d: /d: Is a directory
  
   *  The terminal process "E:\msys64\msys2_shell.cmd -msys2 -defterm -no-start -where E:\dev\npu /d /c 'make.exe' 'all'" terminated with exit code: 126. 
   *  Terminal will be reused by tasks, press any key to close it.
modified the milestones: November 2023, December 2023 on Nov 27, 2023
Gn3po4g

Gn3po4g commented on Dec 30, 2023

@Gn3po4g

Version 1.85.1 still has this problem.
image

39 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
VS Code is still adding `/d /c` to task commands · Issue #169821 · microsoft/vscode