Skip to content

Execution in CMD Instead of Default Terminal Profile on Windows #53

@MoellerMarcel

Description

@MoellerMarcel

First of all, thanks for developing this awesome extension!

I'm running vscode on Windows. However, for projects involving tasks, I set my default shell to Git Bash to be able to write cross-platform compatible Taskfiles.

Now, if I start a task via the extension, I believe it will execute the commands in CMD. I think this is quite problematic as a fixed default for Windows, since PowerShell has at least some command aliases for typical Linux-style commands.

Thus, I would suggest two changes:

  1. Have the extension respect the default terminal profile.
  2. Have an option to choose a specific shell.

For anyone having the same problem, as a workaround, I'm currently using the option "outputTo": "terminal".

How to reproduce:

version: '3'

tasks:
  ls:
    cmds:
      - ls

With the above Taskfile, if I run the task ls from the extension and have "outputTo": "output", I get the following output:

task: [ls] ls
"ls": executable file not found in $PATH
task: Failed to run task "ls": exit status 127
task: Failed to run task "ls": exit status 127
task: completed with code 201

However, if I set "outputTo": "terminal" and last used Git Bash, running the task ls from the extension, I get the expected output:

$ task ls
task: [ls] ls
Taskfile.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    os: windowsIssues that affect users on Windows.state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions