Using zsh when run task in vscode
Asked Answered
R

2

6

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

Rugging answered 13/2, 2017 at 11:18 Comment(0)
M
5

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 :)

Malik answered 3/2, 2022 at 10:49 Comment(0)
D
4

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

Distiller answered 18/4, 2018 at 9:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.