summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorapocelipes <[email protected]>2025-11-02 21:01:41 +0800
committerapocelipes <[email protected]>2025-11-02 21:01:41 +0800
commit0215721fbd83887be071792a8e8b87262b3c71bd (patch)
tree6c118ca12f56fb6e189ab12e17a65ccb5712e12b
parentb3a2dba93a185f205dbd18a154e42da72fdd4881 (diff)
improve(tty): support detect ghostty
-rw-r--r--xmake/core/base/tty.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/xmake/core/base/tty.lua b/xmake/core/base/tty.lua
index 471fb355a..d35705770 100644
--- a/xmake/core/base/tty.lua
+++ b/xmake/core/base/tty.lua
@@ -291,6 +291,7 @@ end
-- - terminator
-- - rxvt
-- - lxterminal
+-- - ghostty
-- - unknown
--
function tty.term()
@@ -305,6 +306,8 @@ function tty.term()
term = "vscode"
elseif TERM_PROGRAM == "mintty" then
term = "mintty" -- git bash
+ elseif TERM_PROGRAM == "ghostty" then
+ term = "ghostty"
end
end
end
@@ -313,7 +316,9 @@ function tty.term()
if term == nil then
local TERM = os.getenv("TERM")
if TERM ~= nil then
- if TERM:find("xterm", 1, true) then
+ if TERM:find("ghostty", 1, true) then
+ term = "ghostty"
+ elseif TERM:find("xterm", 1, true) then
term = "xterm"
elseif TERM == "cygwin" then
term = "cygwin"