diff options
| author | ruki <[email protected]> | 2022-01-16 11:49:27 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-01-16 11:49:27 +0800 |
| commit | bd508b6fb1cf41646525950b6f02bfccc5b540e3 (patch) | |
| tree | 6da7b0b00a532c0138184d28fd0e0d7f90d7bc1a | |
| parent | 5fc94568782eb39b6bfb4431d467f5874ea69edd (diff) | |
support old core
| -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 |
