diff options
| author | ruki <[email protected]> | 2025-09-13 22:34:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-09-13 22:34:40 +0800 |
| commit | e50f21b7a0202cf5d9ea4e1e09abfd6ac6c6f631 (patch) | |
| tree | ce1e1f56545dfc1438388eabb4add4582dd871f7 | |
| parent | db0a39763225e745d11b2f994b9366258ad42e31 (diff) | |
Update tty.lua
| -rw-r--r-- | xmake/core/base/tty.lua | 29 |
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 + |
