From 7286c2adab92ccacd8944cbe59b5bd470b3427bd Mon Sep 17 00:00:00 2001 From: rootiest Date: Sat, 8 Feb 2025 20:20:00 -0500 Subject: [PATCH] add is_ghostty function to identify when terminal is ghostty --- lua/data/func.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lua/data/func.lua b/lua/data/func.lua index fcb5558..ac31e91 100644 --- a/lua/data/func.lua +++ b/lua/data/func.lua @@ -58,6 +58,16 @@ function M.is_wezterm() return false end +---@function Check if the terminal is ghostty +---@return boolean condition true if the terminal is ghostty, false otherwise +function M.is_ghostty() + local gterm = os.getenv('TERM_PROGRAM') + if gterm and string.find(gterm, 'ghostty') then + return true + end + return false +end + ---@function Check if the terminal is neovide ---@return boolean condition true if the terminal is neovide, false otherwise function M.is_neovide()