From 3519892943a5d459f5ae402acd2b23915c6266bf Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Thu, 1 May 2025 18:06:54 +0800 Subject: [PATCH] =?UTF-8?q?fix=20nvim:=20=E5=9C=96=E7=89=87=E9=A1=AF?= =?UTF-8?q?=E7=A4=BA=E5=9C=A8GUI=E4=B8=8D=E6=94=AF=E6=8F=B4=EF=BC=8C?= =?UTF-8?q?=E8=A6=81=E5=8B=95=E6=85=8B=E9=97=9C=E9=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exact_plugins/exact_components/image.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dot_config/nvim/exact_lua/exact_plugins/exact_components/image.lua b/dot_config/nvim/exact_lua/exact_plugins/exact_components/image.lua index 3babda1..16d8088 100644 --- a/dot_config/nvim/exact_lua/exact_plugins/exact_components/image.lua +++ b/dot_config/nvim/exact_lua/exact_plugins/exact_components/image.lua @@ -2,6 +2,22 @@ return { { "3rd/image.nvim", build = false, -- so that it doesn't build the rock https://github.com/3rd/image.nvim/issues/91#issuecomment-2453430239 + -- cond = not vim.g.neovide and not vim.fn.has("goneovim") == 1 and not vim.fn.has("gui_running") == 1, + cond = function() + -- 如果是在 GUI(如 NeoVide、Goneovim)中,則不啟用插件 + if vim.g.neovide or vim.fn.has("goneovim") == 1 or vim.fn.has("gui_running") == 1 then + return false + end + + -- 獲取 TERM 環境變數 + local term = vim.fn.getenv("TERM") + -- 檢查是否是常見的文字終端 + local is_terminal = term and (term:match("xterm") or term:match("screen") or term:match("tmux") or term:match("linux")) + + -- 如果是文字終端,則啟用插件 + return is_terminal ~= nil + end, + lazy = false, opts = { backend = "ueberzug", processor = "magick_cli", -- or "magick_rock"