Support external file drag-and-drop for local copy and SSH upload
Feature request
Support dragging files from an external file manager (such as Finder or Windows Explorer) into Fresh to copy them into the current workspace. When a locally running Fresh is editing an SSH workspace, the same action should upload the files into the remote workspace.
The intended operation is to copy the actual files, preserving the originals, rather than inserting their paths or contents into the editor buffer.
Use case
While editing a project, I want to bring in images, documents, or other assets from my computer without switching to a shell to run a copy or upload command. The workflow should also work when I open a remote project with fresh user@host:/path/to/project.
Scope and priorities
- Core requirement: local copy. With Fresh running locally on a local workspace, dropping an external file copies it into the chosen project directory.
- Primary extension: upload from local Fresh to an SSH workspace. With Fresh running on my computer and connected to a remote workspace, dropping a local file transfers its bytes over SSH and saves it in the chosen remote directory.
- Optional follow-up: Fresh running on the server. If I SSH into a server and run Fresh there, local drag-and-drop upload would also be useful. This may require terminal integration or a local helper and should not block the first two cases.
Suggested behavior
- Use the selected directory in Fresh's file explorer as the destination, or offer a destination picker. Targeting the directory under the drop pointer could be supported where the frontend/terminal provides that information.
- Handle multiple files, including paths with spaces and non-ASCII characters.
- Make filename conflicts explicit, with overwrite, skip, or rename choices.
- Show progress and allow cancellation for uploads or larger copies; report failures and refresh the file explorer after success.
- Avoid mistaking ordinary text pastes for file imports. An explicit import/drop mode or confirmation would be reasonable where terminal input cannot distinguish them reliably.
Implementation considerations
Terminal drag-and-drop behavior varies: a terminal may send only a quoted or escaped local path, rather than a distinct file-drop event or file bytes. The supported behavior should be documented for the relevant terminals/frontends.
For a locally running Fresh connected to an SSH workspace, the existing remote filesystem/agent infrastructure looks like a useful starting point. Importing a local file still needs an explicit local-read-to-remote-write transfer; a remote filesystem copy operation alone would only copy files already on the server.
For Fresh running directly on a remote server, a local path string is insufficient: a local terminal integration/helper would need to provide the file bytes. This is an optional compatibility extension, not a prerequisite for local copy and local-Fresh-to-SSH upload.
Related work
- #3190 requests dragging files from the explorer into the editing area to open tabs/splits. This request concerns importing external files into the workspace.
- #3053 requests multi-selection and file operations in the explorer.
- #1658 proposed explorer cut/copy/paste and multi-selection (closed, not merged).
I could not find an existing issue specifically covering external file drops for local copy and SSH upload.
Source: sinelaw/fresh