From 2ff2a3a97f3652e1f43194a39b194bcfd4fbbf40 Mon Sep 17 00:00:00 2001 From: Oleg Samarin Date: Tue, 9 Jun 2026 17:09:17 +0300 Subject: [PATCH] Fixed Copy menu item being disabled in the terminal context menu when text was selected by mouse drag while Claude Code's TUI had mouse reporting enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JediTerm's right-click Copy is enabled iff TerminalPanel.mySelection != null at popup-build time. When the running TUI has enabled mouse reporting (DECSET 1000/1006), JediTerm forwards plain left-button drag events to the application instead of creating a local TerminalSelection — so the user sees no selection in JediTerm's model and Copy is permanently disabled. Claude Code toggles mouse reporting dynamically based on its TUI state, which is why the bug appeared profile-dependent. NetBeansSettingsProvider now overrides forceActionOnMouseReporting() to return true, which makes JediTerm's isLocalMouseAction() always true and lets mouse drag create a selection regardless of the application's mouse-tracking state. Click forwarding to the TUI is not relied upon by the plugin (option menus are handled separately by ScreenContentDetector and ChoiceMenuPanel), so suppressing it has no user-visible cost. Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 2 ++ pom.xml | 2 +- .../claudecodegui/ui/NetBeansSettingsProvider.java | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a95c915..ea2b2573 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +- Fixed Copy menu item being disabled in the terminal context menu when text was selected by mouse drag while Claude Code's TUI had mouse reporting enabled + # 1.2.14 (2026-06-01) - Fixed mode switching (e.g. auto → plan) becoming unreliable when Claude Code is actively working: the edit-mode selector now correctly reaches the target mode without overshooting diff --git a/pom.xml b/pom.xml index 72961232..8cde9216 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.github.nbplugins netbeans-plugin-claude-code-gui - 1.2.18-SNAPSHOT + 1.2.21-SNAPSHOT nbm Netbeans Plugin Claude Code GUI NetBeans plugin that provides a GUI for Claude Code CLI — run claude code sessions directly inside the IDE. diff --git a/src/main/java/io/github/nbplugins/claudecodegui/ui/NetBeansSettingsProvider.java b/src/main/java/io/github/nbplugins/claudecodegui/ui/NetBeansSettingsProvider.java index 9a1fe22b..bf688372 100644 --- a/src/main/java/io/github/nbplugins/claudecodegui/ui/NetBeansSettingsProvider.java +++ b/src/main/java/io/github/nbplugins/claudecodegui/ui/NetBeansSettingsProvider.java @@ -70,4 +70,18 @@ public TextStyle getSelectionColor() { public com.jediterm.terminal.emulator.ColorPalette getTerminalColorPalette() { return ColorPaletteImpl.XTERM_PALETTE; } + + /** + * Forces JediTerm to treat mouse drags as local actions even when the + * running TUI (Claude Code) has enabled mouse reporting (DECSET 1000/1006). + * Without this, plain left-button drag is forwarded to the application + * instead of creating a text selection, so the right-click "Copy" menu item + * is permanently disabled (it is enabled iff {@code TerminalPanel.mySelection != null}). + * Claude Code's TUI does not rely on click-forwarding — option menus are + * handled separately by {@code ScreenContentDetector}/{@code ChoiceMenuPanel}. + */ + @Override + public boolean forceActionOnMouseReporting() { + return true; + } }