How to open zsh terminals using vs code tasks in wsl?

Viewed 18

My aim is to open zsh terminals in the current working directory of wsl whenever I open a workspace. For example, if I open a workspace with three folders, viz. test1, test2, and test3, I want one terminal in each directory to open in vs code.

For that purpose, I created .vscode/tasks.json file in each directory and input the following code:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "test1",
      "type": "shell",
      "command": "",
      "isBackground": true,
      "problemMatcher": [],
      "options": {
        "shell": {
          "executable": "zsh",
          "args": []
        }
      },
      "runOptions": {
        "runOn": "folderOpen"
      },
      "presentation": {
        "reveal": "always",
        "panel": "dedicated"
      }
    }
  ]
}

But in the terminal, I get this error:

 *  Executing task in folder illuminate:

/usr/bin/zsh: can't open input file:

 *  The terminal process "zsh ''" failed to launch (exit code: 127).
 *  Terminal will be reused by tasks, press any key to close it.

I checked the docs, but it includes settings only useful for windows, not linux. Is there any way to achieve this?

0 Answers
Related