From ea8fdd3d532ac911689a0dcb9d96326da832b2a8 Mon Sep 17 00:00:00 2001 From: smoose Date: Thu, 8 Jan 2026 16:36:53 +0800 Subject: [PATCH] fix: skip selection tracking in terminal mode to prevent flicker When moving cursor in Claude Code's interactive terminal UI, each cursor movement was triggering selection update API calls that caused screen flickering. This fix checks the current mode and skips selection tracking when in terminal mode ('t'). Co-Authored-By: Claude Opus 4.5 --- lua/claudecode/selection.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/claudecode/selection.lua b/lua/claudecode/selection.lua index 9bbfed9..abd3a74 100644 --- a/lua/claudecode/selection.lua +++ b/lua/claudecode/selection.lua @@ -88,6 +88,10 @@ end ---Handles cursor movement events. ---Triggers a debounced update of the selection. function M.on_cursor_moved() + local current_mode = vim.fn.mode() + if current_mode == "t" then + return + end M.debounce_update() end