summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-01-16 11:49:27 +0800
committerruki <[email protected]>2022-01-16 11:49:27 +0800
commitbd508b6fb1cf41646525950b6f02bfccc5b540e3 (patch)
tree6da7b0b00a532c0138184d28fd0e0d7f90d7bc1a
parent5fc94568782eb39b6bfb4431d467f5874ea69edd (diff)
support old core
-rw-r--r--xmake/core/base/tty.lua14
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