Skip to content

feat: drag files from explorer sidebar to terminal#82

Merged
nwparker merged 2 commits intomainfrom
nwparker/drag-file-to-terminal
Mar 24, 2026
Merged

feat: drag files from explorer sidebar to terminal#82
nwparker merged 2 commits intomainfrom
nwparker/drag-file-to-terminal

Conversation

@nwparker
Copy link
Copy Markdown
Contributor

@nwparker nwparker commented Mar 24, 2026

Summary

  • File explorer sidebar items are now draggable
  • Dropping a file onto the terminal pastes its shell-escaped absolute path into the active pane
  • Uses a custom MIME type (text/x-orca-file-path) so it doesn't interfere with native OS file drops

Changes

  • FileExplorer.tsx: Added draggable and onDragStart to file/folder buttons
  • TerminalPane.tsx: Added onDragOver/onDrop handlers that send the path via PTY transport
  • preload/index.ts: Skip global drop handler for in-app drags so React's onDrop fires

Test plan

  • Drag a file from the explorer onto the terminal → path appears at cursor
  • Drag a file with spaces in the name → path is properly shell-escaped
  • Native OS file drop still works as before
  • Dragging a folder also works (pastes folder path)

🤖 Generated with Claude Code

nwparker and others added 2 commits March 23, 2026 23:52
Makes file explorer items draggable and adds a drop handler on the
terminal pane. Dropping a file from the sidebar types its shell-escaped
absolute path into the active terminal, useful for CLI tools like
claude code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The preload script's global drop handler was capturing and swallowing
all drop events before React handlers could fire. Skip the preload
handler when the drop contains the in-app MIME type so it reaches
the TerminalPane's onDrop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nwparker nwparker merged commit 34c3fbe into main Mar 24, 2026
@nwparker nwparker deleted the nwparker/drag-file-to-terminal branch March 24, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant