summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/core/base/tty.lua19
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