Checklist
Request
Dragging an image file onto an agent-shell buffer should attach it to the prompt, the way agent-shell-send-clipboard-image and agent-shell-yank-dwim already do for the clipboard.
Current behaviour
agent-shell-mode doesn't handle drops, so a drop falls through to Emacs' default dnd-protocol-alist handling and the image is opened in its own buffer, taking over the window. Nothing reaches the prompt.
Suggested behaviour
On a file:// drop in an agent-shell buffer, insert the file as prompt context — the same thing agent-shell-yank-dwim already does once it has a path:
(agent-shell-insert
:text (agent-shell--get-files-context :files (list path))
:shell-buffer (agent-shell--shell-buffer))
A buffer-local dnd-protocol-alist entry set up in agent-shell-mode would cover it.
Two things worth deciding:
- Non-image files: attaching a dropped
.log/.csv/source file as context seems just as useful, but falling back to dnd-open-file for anything non-image is a defensible scope too.
- Drops that carry image data rather than a file URL (dragging an image straight out of a browser) could reuse the existing save-to-
.agent-shell/screenshots path from agent-shell--save-clipboard-image before inserting.
Why
Clipboard paste covers freshly-taken screenshots well. Drag-and-drop covers the other half: images that already exist as files — a design mockup, a diagram, a screenshot sitting in Finder or Dired — where today the route is copying the path out by hand.
Checklist
Request
Dragging an image file onto an
agent-shellbuffer should attach it to the prompt, the wayagent-shell-send-clipboard-imageandagent-shell-yank-dwimalready do for the clipboard.Current behaviour
agent-shell-modedoesn't handle drops, so a drop falls through to Emacs' defaultdnd-protocol-alisthandling and the image is opened in its own buffer, taking over the window. Nothing reaches the prompt.Suggested behaviour
On a
file://drop in anagent-shellbuffer, insert the file as prompt context — the same thingagent-shell-yank-dwimalready does once it has a path:A buffer-local
dnd-protocol-alistentry set up inagent-shell-modewould cover it.Two things worth deciding:
.log/.csv/source file as context seems just as useful, but falling back todnd-open-filefor anything non-image is a defensible scope too..agent-shell/screenshotspath fromagent-shell--save-clipboard-imagebefore inserting.Why
Clipboard paste covers freshly-taken screenshots well. Drag-and-drop covers the other half: images that already exist as files — a design mockup, a diagram, a screenshot sitting in Finder or Dired — where today the route is copying the path out by hand.