summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-09-13 22:34:40 +0800
committerGitHub <[email protected]>2025-09-13 22:34:40 +0800
commite50f21b7a0202cf5d9ea4e1e09abfd6ac6c6f631 (patch)
treece1e1f56545dfc1438388eabb4add4582dd871f7
parentdb0a39763225e745d11b2f994b9366258ad42e31 (diff)
Update tty.lua
-rw-r--r--xmake/core/base/tty.lua29
1 files changed, 16 insertions, 13 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua
index 8df056d61..1e44c64bf 100644
--- a/xmake/core/base/tty.lua
+++ b/xmake/core/base/tty.lua
@@ -153,10 +153,11 @@ end
function tty.shell()
local shell = tty._SHELL
if shell == nil then
- local subhost = xmake._SUBHOST
if os.getenv("NU_VERSION") then
shell = "nu"
- else
+ end
+ if not shell then
+ local subhost = xmake._SUBHOST
if subhost == "windows" then
if os.getenv("PROMPT") then
shell = "cmd"
@@ -168,17 +169,18 @@ function tty.shell()
shell = "powershell"
end
end
- else
- shell = os.getenv("XMAKE_SHELL")
- 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
+ shell = os.getenv("XMAKE_SHELL")
+ 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
@@ -449,3 +451,4 @@ end
-- return module
return tty
+