summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-30 22:50:56 +0800
committerruki <[email protected]>2025-10-30 22:50:56 +0800
commitaa46a3037fbd036e060fc86bfc886cc073d7e112 (patch)
tree6ec49392c10b8207b16eb2e9389cd923baa0dade
parent10c6280634086074ad5bdcb6c4c4ce6013adcf3c (diff)
improve isatty
-rw-r--r--xmake/core/base/io.lua5
-rw-r--r--xmake/modules/utils/progress.lua2
2 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/base/io.lua b/xmake/core/base/io.lua
index d58d46297..f35c01ab3 100644
--- a/xmake/core/base/io.lua
+++ b/xmake/core/base/io.lua
@@ -254,6 +254,10 @@ end
-- this file is a tty?
function _file:isatty()
+ local isatty_cached = self._ISATTY
+ if isatty_cached ~= nil then
+ return isatty_cached
+ end
-- ensure opened
local ok, errors = self:_ensure_opened()
@@ -266,6 +270,7 @@ function _file:isatty()
if ok == nil and errors then
errors = string.format("%s: %s", self, errors)
end
+ self._ISATTY = ok
return ok, errors
end
diff --git a/xmake/modules/utils/progress.lua b/xmake/modules/utils/progress.lua
index e3094223b..223b7840a 100644
--- a/xmake/modules/utils/progress.lua
+++ b/xmake/modules/utils/progress.lua
@@ -269,9 +269,9 @@ function _show_progress_with_multirow_refresh(progress, format, ...)
-- build and display the subprocess lines
local order_lineinfos = _build_ordered_subprocess_lineinfos()
- current_lineinfo.start_time = current_time
_display_subprocess_lines(order_lineinfos)
+ current_lineinfo.start_time = current_time
if is_finished then
_g.refresh_mode = nil
_g.progress_lineinfos = nil