diff options
Diffstat (limited to 'xmake/core/base/tty.lua')
| -rw-r--r-- | xmake/core/base/tty.lua | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index 56d6f9942..8df056d61 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -154,26 +154,30 @@ function tty.shell() local shell = tty._SHELL if shell == nil then local subhost = xmake._SUBHOST - if subhost == "windows" then - if os.getenv("PROMPT") then - shell = "cmd" - else - local ok, result = os.iorun("pwsh -v") - if ok then - shell = "pwsh" + if os.getenv("NU_VERSION") then + shell = "nu" + else + if subhost == "windows" then + if os.getenv("PROMPT") then + shell = "cmd" else - shell = "powershell" + local ok, result = os.iorun("pwsh -v") + if ok then + shell = "pwsh" + else + shell = "powershell" + end 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 + 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 |
