randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.39k stars 81 forks source link

Using terminus_open in a build system with zsh... #266

Open thezimmee opened 3 years ago

thezimmee commented 3 years ago

When I manually open Terminus in a tab or panel, it runs zsh, which is what I expect. However, when I run terminus_open in a build system, it always uses sh. How can I get it to always use zsh?

Here is my build system configuration:

"build_systems": [
    {
      "name": "Run my command",
      "target": "terminus_open",
      "cancel": "terminus_cancel_build",
      "shell_cmd": "npm run myScript",
      "working_dir": "$project_path",
      "tag": "zsh",
      "auto_close": false
    },
]

And here are my terminus settings:

{
    "scrollback_history_size": 100000,
    "256color": true,
    "shell_configs":
    [
        {
            "cmd":
            [
                "zsh",
                "-i",
                "-l"
            ],
            "default": true,
            "enable": true,
            "env":
            {
            },
            "name": "Zsh",
            "platforms":
            [
                "linux",
                "osx"
            ]
        },
        {
            "cmd":
            [
                "bash",
                "-i",
                "-l"
            ],
            "default": false,
            "enable": true,
            "env":
            {
            },
            "name": "Bash",
            "platforms":
            [
                "linux",
                "osx"
            ]
        },
        {
            "cmd": "cmd.exe",
            "default": false,
            "enable": true,
            "env":
            {
            },
            "name": "Command Prompt",
            "platforms":
            [
                "windows"
            ]
        },
        {
            "cmd": "powershell.exe",
            "default": false,
            "enable": true,
            "env":
            {
            },
            "name": "Power Shell",
            "platforms":
            [
                "windows"
            ]
        },
        {
            "cmd": "wsl.exe",
            "default": false,
            "enable": true,
            "env":
            {
            },
            "name": "WSL Login Shell",
            "platforms":
            [
                "windows"
            ]
        }
    ],
    "theme": "solarized-dark-higher-contrast",
    "unix_term": "xterm-256color",
    "user_theme_colors":
    {
        "background": "hsl(208, 20%, 18%)",
        "black": "hsl(0, 0%, 0%)",
        "blue": "hsl(208, 60%, 50%)",
        "brown": "hsl(47, 70%, 50%)",
        "cyan": "hsl(181, 70%, 58%)",
        "foreground": "hsl(208, 21%, 85%)",
        "green": "hsl(121, 60%, 63%)",
        "light_black": "hsl(0, 0%, 0%)",
        "light_blue": "hsl(208, 60%, 50%)",
        "light_brown": "hsl(47, 70%, 50%)",
        "light_cyan": "hsl(181, 70%, 58%)",
        "light_green": "hsl(121, 60%, 63%)",
        "light_magenta": "hsl(252, 70%, 77%)",
        "light_red": "hsl(10, 70%, 43%)",
        "light_white": "hsl(208, 21%, 85%)",
        "magenta": "hsl(252, 70%, 77%)",
        "red": "hsl(10, 70%, 43%)",
        "white": "hsl(208, 21%, 85%)"
    }
}

I appreciate any help. And I really appreciate the wonderful work on this plugin!

thezimmee commented 3 years ago

The same unexpected behavior occurs when I create a custom sublime command. For example, the following custom command:

{
    "caption": "Which sh",
    "command": "terminus_open",
    "args": {
      "shell_cmd": "which sh",
      "cwd": "$project_path",
      "auto_close": false
    }
}

outputs /bin/sh, where I expect it to be my zsh path.