diff --git a/docs/dnd-protocol.rst b/docs/dnd-protocol.rst index 230beab9a..479b86555 100644 --- a/docs/dnd-protocol.rst +++ b/docs/dnd-protocol.rst @@ -387,7 +387,8 @@ Dragging to remote machines ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ To support dragging to remote machines, first of all clients **must** pre-send -the data for the ``text/uri-list`` MIME type. Then, terminals can +the data for the ``text/uri-list`` MIME type. All ``file://`` URLs that point +to directories **must** end with a ``/``. Then, terminals can examine the :ref:`machine_id` sent with the enable drag offers ``t=o`` escape code to decide whether to request data for ``file://`` entries from the URI list. To request data for a particular entry, terminals send an diff --git a/kittens/dnd/main.go b/kittens/dnd/main.go index 5036b746c..3bf51a397 100644 --- a/kittens/dnd/main.go +++ b/kittens/dnd/main.go @@ -395,6 +395,9 @@ func dnd_main(cmd *cli.Command, opts *Options, args []string) (rc int, err error if runtime.GOOS == "windows" && !strings.HasPrefix(upath, "/") { upath = "/" + upath } + if st.IsDir() && !strings.HasSuffix(upath, "/") { + upath += "/" + } u := &url.URL{Scheme: "file", Path: upath} uri_list = append(uri_list, uri_list_item{path: path, uri: u.String(), human_name: arg, metadata: st}) } else {