Skip to content

Accept dropped image files and pasted screenshots, pipe to active agent #56

@AThraen

Description

@AThraen

Generated from a competitor-analysis pass (TerminalConductor, May 2026).

Summary

When the user drops an image file onto a terminal pane, or pastes a screenshot from the clipboard, CodeShellManager inserts the image path into the active terminal so the running agent (Claude Code, Codex, Gemini CLI) can read it.

Motivation

Claude Code, Codex, and Gemini CLI all support image references in prompts via a file path. Today the user must save the image to disk, find the path, and type it manually — particularly painful for screenshots, which is the most common case. Drag/drop + clipboard paste solves the friction directly.

Proposed behaviour

Drag-drop (file path on the clipboard)

WebView2 receives a FileDrop event. We resolve the path list, filter to image extensions (.png .jpg .jpeg .gif .webp .bmp), and for each:

  1. Quote the absolute path if it contains spaces.
  2. Type it into the active terminal via TerminalBridge.WriteInput(path + ' ') (no \r — user reviews and presses Enter).
  3. Toast: "Image path inserted — press Enter to send".

Paste from clipboard (bitmap)

If Clipboard.ContainsImage() returns true (and not a file path):

  1. Write the bitmap to %TEMP%\codeshellmanager-pastes\<guid>.png.
  2. Treat as the drag-drop case above with that path.

Cleanup

On app startup, delete files in %TEMP%\codeshellmanager-pastes\ older than 24h.

Non-agent shells

Only insert the path for sessions whose command matches ClaudeSessionService.IsClaudeCommand or similar known-agent detection. For plain pwsh / cmd, fall back to copying the path to the clipboard with a "Path copied — paste it where you need" toast.

Out of scope

  • Auto-execute (we never send \r automatically — too easy to send the wrong thing).
  • Remote SSH image upload (separate feature; TC has it as drag-drop-to-SSH-tab).
  • Multi-image drops in one go (start with one; extend later if needed).

Inspiration

TerminalConductor's "Drag & Drop Image Files to Read" and screenshot-paste features. See https://terminalconductor.com/ → Features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions