diff options
| author | ruki <[email protected]> | 2023-03-03 22:53:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-03-03 22:53:55 +0800 |
| commit | 06ab760da4fa6ac649f617065cbee5024b82b575 (patch) | |
| tree | 7233ab69f1f6f63f2b8f152899e50ec60c89b739 | |
| parent | c464a7c482ced95d40452a3ca4eee66220567d44 (diff) | |
improve os.shell
| -rw-r--r-- | xmake/core/base/tty.lua | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index f6fa0b622..842d5474b 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -166,20 +166,23 @@ function tty.shell() end end else - shell = os.getenv("SHELL") - if shell then - for _, shellname in ipairs({"zsh", "bash", "sh"}) do - if shell:find(shellname) then - shell = shellname - break + if not shell and os.getenv("FISH_VERSION") then + shell = "fish" + end + if not shell then + shell = os.getenv("SHELL") + if shell then + for _, shellname in ipairs({"zsh", "bash", "sh"}) do + if shell:find(shellname) then + shell = shellname + break + end end end end if not shell then if os.getenv("BASH_VERSION") then shell = "bash" - elseif os.getenv("FISH_VERSION") then - shell = "fish" end end end |
