Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
71 opened this issue Dec 22, 2022 · 6 comments · Fixed by #181760 or #236058 · May be fixed by #238440
Open

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

71 opened this issue Dec 22, 2022 · 6 comments · Fixed by #181760 or #236058 · May be fixed by #238440
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tasks Task system issues

Comments

@71
Copy link
Contributor

71 commented Dec 22, 2022

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?

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug tasks Task system issues labels Jan 6, 2023
@meganrogge meganrogge added this to the Backlog milestone Jan 6, 2023
@hptechdesign
Copy link

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
Copy link

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.

@Gn3po4g
Copy link

Gn3po4g commented Dec 30, 2023

Version 1.85.1 still has this problem.
image

@meganrogge meganrogge removed this from the December / January 2024 milestone Jan 22, 2024
@DarkRRb
Copy link

DarkRRb commented Aug 13, 2024

So what about now?

I have an AutoRun script in cmd to configure fnm, but because it forces the addition of \d \c, I'm currently unable to inject the environment into the terminal for tasks.

@mkaraden
Copy link

mkaraden commented Sep 9, 2024

Version 1.91.1 still has it

image

@CasparNuel
Copy link

1.95.3 is still showing this behavior. Using msys64 as a build and test system with tasks and launch scripts is a major pain without being able to use the msys setup script. Manually managing the environment is prone to human error.

Is there any progress on completing this issue or, or merging Legend-Master's solution?

@meganrogge meganrogge added this to the January 2025 milestone Dec 11, 2024
@vs-code-engineering vs-code-engineering bot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 12, 2024
@meganrogge meganrogge reopened this Dec 13, 2024
@vs-code-engineering vs-code-engineering bot removed the insiders-released Patch has been released in VS Code Insiders label Dec 13, 2024
@vs-code-engineering vs-code-engineering bot added the unreleased Patch has not yet been released in VS Code Insiders label Dec 17, 2024
@vs-code-engineering vs-code-engineering bot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Dec 18, 2024
@meganrogge meganrogge reopened this Dec 20, 2024
@meganrogge meganrogge removed this from the January 2025 milestone Dec 20, 2024
@vs-code-engineering vs-code-engineering bot removed the insiders-released Patch has been released in VS Code Insiders label Dec 20, 2024
@dylanchu dylanchu linked a pull request Jan 22, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment