wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

drag-and-drop folder/file support

Open AlbertoVf opened this issue 7 months ago • 1 comments

Is your feature request related to a problem? Please describe.
I'm often working with file paths and would like to drag folders or files from my file manager directly into WezTerm. Currently, dragging and dropping a folder into the terminal doesn't result in anything — no path is inserted. This feature is common in other terminals and helps avoid typing long paths manually.

Describe the solution you'd like
I’d like WezTerm to support drag-and-drop of files or folders from the desktop environment or file manager. When a folder is dragged into the terminal window, WezTerm should insert the full path (escaped if needed) at the cursor position.

Describe alternatives you've considered
I currently open WezTerm with wezterm start --cwd /some/path, or I copy-paste the folder path manually. These are slower and interrupt the workflow compared to direct drag-and-drop.

Additional context
Many terminal emulators (like GNOME Terminal, iTerm2, Alacritty via Wayland, etc.) already support this behavior. It’s especially helpful when working in GUI file managers alongside CLI workflows.
This could potentially be implemented via a configuration event like on_drop or handled at the compositor level if possible.

AlbertoVf avatar Jun 09 '25 14:06 AlbertoVf

This might be a duplicate of https://github.com/wezterm/wezterm/issues/6798

@digitallyserviced started a PR for this a few month ago to allow customizing what happens when dropping something on the terminal https://github.com/wezterm/wezterm/pull/6803 but it's currently on hold.

But dropping a file on the Terminal should already work even if a bit crude and not very customizable 🤔 https://wezterm.org/config/lua/config/quote_dropped_files.html

bew avatar Jun 09 '25 22:06 bew