From bd508b6fb1cf41646525950b6f02bfccc5b540e3 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 16 Jan 2022 11:49:27 +0800 Subject: support old core --- xmake/core/base/tty.lua | 14 ++++++++------ 1 file 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 -- cgit v1.3.1