diff options
| -rw-r--r-- | xmake/core/base/tty.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua index a744f12e0..4ef3bb768 100644 --- a/xmake/core/base/tty.lua +++ b/xmake/core/base/tty.lua @@ -402,12 +402,14 @@ end -- function tty.term_mode(stdtype, newmode) local oldmode = 0 - if stdtype == "stdin" then - oldmode = tty._term_mode(1, newmode) - elseif stdtype == "stdout" then - oldmode = tty._term_mode(2, newmode) - elseif stdtype == "stderr" then - oldmode = tty._term_mode(3, newmode) + if tty._term_mode then + if stdtype == "stdin" then + oldmode = tty._term_mode(1, newmode) + elseif stdtype == "stdout" then + oldmode = tty._term_mode(2, newmode) + elseif stdtype == "stderr" then + oldmode = tty._term_mode(3, newmode) + end end return oldmode end |
