[BUG] JetBrains plugin: "Send to Claude Code" (Ctrl+Alt+K) does nothing when the Markdown preview pane is focused

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 3, 2026

Environment

  • Claude Code JetBrains plugin: 0.1.14-beta
  • IDE: IntelliJ IDEA 2025.3
  • OS: macOS

Steps to reproduce

  1. Open a .md file and switch to the Preview pane (or focus the preview side of the split view).
  2. Select some text in the rendered preview.
  3. Trigger "Send to Claude Code" — via Ctrl+Alt+K / Cmd+Option+K, the editor right-click menu, or the floating code toolbar.

Expected: the selection (or at least an @File reference) is sent to Claude Code and the terminal is focused.
Actual: nothing happens. The action is greyed out / absent, and the shortcut is a no-op. It only works when a text editor is focused.

Note: the "file reference shortcut" Cmd+Option+K / Ctrl+Alt+K described in the docs is the same action as Send to Claude Code (there is only one action bound to that keystroke), so it is not a separate escape hatch — it fails from the preview for the same reason.

Root cause

Send to Claude Code (com.anthropic.code.plugin.actions.SendToClaudeAction) is bound entirely to the text Editor:

  • Registered in EditorPopupMenu + Floating.CodeToolbar with shortcut Ctrl+Alt+K (Cmd+Option+K on macOS).
  • update() enables it only when e.getData(CommonDataKeys.EDITOR) != null (and Claude is connected).
  • actionPerformed() reads editor = e.getData(CommonDataKeys.EDITOR) and calls sendAtMentionedNotifications(mcp, editor)NotificationManager.sendAtMentionedNotification(Editor), which builds the @File#Lx-Ly at-mention from editor.getSelectionModel(), then focuses Claude in the terminal.

The Markdown preview is a JCEF pane (MarkdownJCEFHtmlPanel) — a FileEditor, but not a TextEditor, so CommonDataKeys.EDITOR is null in its data context. The action is therefore disabled/invisible in the preview and the shortcut does nothing. The same happens for any .md opened in preview-only mode.

Proposed fix

Don't require CommonDataKeys.EDITOR. When it's null, resolve the underlying text editor from the active FileEditor:

  • If the selected editor is a TextEditorWithPreview (the standard Markdown split editor), use its embedded getTextEditor().getEditor(); otherwise fall back to FileEditorManager.getInstance(project).getSelectedEditor()'s text editor.
  • Then send an @File at-mention for that file — using the source selection if there is one, or a whole-file @File reference otherwise. This makes the action / shortcut / menu item work from the preview.

Optionally, to honor what was actually highlighted in the preview, read the JCEF DOM selection via JBCefJSQuery (window.getSelection().toString()) and send it as the at-mention text (best-effort; no line range). Also worth registering the action in the Markdown preview's context-menu group so it isn't invisible there.

Workaround (today)

Don't rely on the action/shortcut from the preview (it's the broken path). Instead:

  • Select the text in the source editor (split-view left pane / "Editor only" mode) — the selection is then shared automatically (⧉ Selected N lines from <file>), no shortcut needed; or
  • Copy the text and paste it into the Claude prompt manually.

View original on GitHub ↗