summaryrefslogtreecommitdiff
path: root/xmake/core/base/tty.lua
diff options
context:
space:
mode:
authorSaikari <[email protected]>2026-01-27 12:35:58 +0300
committerSaikari <[email protected]>2026-01-27 12:35:58 +0300
commit93b10aae53d6a3fc751894695161b8b472525a4b (patch)
tree532d7bd7c6d376b38fde63136787b3acb04ebfe1 /xmake/core/base/tty.lua
parentb6578fbe40e03b075c9581895d55d256c0c4205b (diff)
limit shell detection loop to prevent infinite iterations
Diffstat (limited to 'xmake/core/base/tty.lua')
-rw-r--r--xmake/core/base/tty.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua
index 9f339e4f4..a162e6341 100644
--- a/xmake/core/base/tty.lua
+++ b/xmake/core/base/tty.lua
@@ -244,7 +244,10 @@ function tty._find_shell_from_parent()
local shell
local pid = os.getpid()
local tmpfile = os.tmpfile()
- while pid ~= 0 do
+ local count = 0
+ while pid ~= 0 and count < 10 do
+ count = count + 1
+ print(count)
local shell_name = nil
local shell_path = nil
if os.isfile("/proc/" .. pid .. "/exe") then