‌‌R‌‌‌.
‌‌R‌‌‌.

Reputation: 2954

Using zsh when run task in vscode

What I want to achieve is using zsh in "output" pane whenever I run a Task in VSCode, but it keep using /bin/sh instead. The "Terminal" pane is using zsh correctly though.

Here's my configurations:

➜  ~ echo $SHELL
/bin/zsh
➜  ~ which zsh
/bin/zsh

tasks.json

{
  "version": "0.1.0",
  "command": "echo Im $0",
  "suppressTaskName": true,
  "isShellCommand": {
    "executable": "/bin/zsh"
  },
  "showOutput": "always",
  "tasks": [
    {
      "taskName": "Test",
      "args": ["test"]
    }
  ]
}

And the output when I run the Task is: Im /bin/sh

Upvotes: 6

Views: 5397

Answers (2)

Romain Leconte
Romain Leconte

Reputation: 74

The recommended way to do this now is the following:

"terminal.integrated.profiles.linux": {
    "zsh": {
      "path": "zsh",
      "args": []
    }
  },
"terminal.integrated.defaultProfile.linux": "zsh"

As the other answer presents the deprecated way to do it.

Note that you can customize this profile with arguments if need be :)

Upvotes: 5

Aditya Kresna Permana
Aditya Kresna Permana

Reputation: 12109

You could change the settings from menu File -> Preferences -> Settings. Then put the options to use zsh shell.

... another lines
... another lines
"terminal.integrated.shell.linux": "zsh"

Screenshot from my experience

Upvotes: 4

Related Questions