{"record":{"id":"f424974a16f67570","repo":"kovidgoyal/kitty","slug":"terminal-asked-for-drag-data-from-uri-list-but-no","errorCode":null,"errorMessage":"terminal asked for drag data from URI list but no list present","messagePattern":"terminal asked for drag data from URI list but no list present","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/dnd/drag.go","lineNumber":488,"sourceCode":"\t\t}\n\t} else {\n\t\tif x.file, err = os.Open(x.path); err != nil {\n\t\t\tdnd.finish_drag(\"EIO\")\n\t\t\treturn err\n\t\t}\n\t\tdnd.drag_status.current_remote_file = x\n\t\tif err = dnd.send_next_file_chunk(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn\n}\n\nfunc (dnd *dnd) on_drag_remote_data_request(idx int) (err error) {\n\tds := dnd.drag_sources[\"text/uri-list\"]\n\tif ds == nil || len(ds.uri_list) < 1 {\n\t\tdnd.finish_drag(\"EINVAL\")\n\t\treturn fmt.Errorf(\"terminal asked for drag data from URI list but no list present\")\n\t}\n\tif idx < 0 || idx >= len(ds.uri_list) {\n\t\tdnd.finish_drag(\"EINVAL\")\n\t\treturn fmt.Errorf(\"terminal asked for drag data from URI list with out of bounds index: %d\", idx)\n\t}\n\tds.uri_list[idx].was_sent = true\n\tdnd.drag_status.remote_data_requests = append(dnd.drag_status.remote_data_requests, idx)\n\tif len(dnd.drag_status.remote_data_requests) == 1 {\n\t\terr = dnd.send_next_remote_data_request()\n\t}\n\treturn\n}\n\nfunc (dnd *dnd) send_next_remote_data_request() (err error) {\n\tif len(dnd.drag_status.remote_data_requests) == 0 {\n\t\treturn nil\n\t}\n\ti := dnd.drag_status.remote_data_requests[0]","sourceCodeStart":470,"sourceCodeEnd":506,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/dnd/drag.go#L470-L506","documentation":"The terminal asked for remote drag data from the text/uri-list drag source, but no drag source with a non-empty uri_list exists. The kitten finishes the drag with EINVAL and returns this error.","triggerScenarios":"on_drag_remote_data_request is called when drag_sources[\"text/uri-list\"] is nil or its uri_list is empty — i.e. the drag was started without any file/URI arguments but the terminal still requested remote data.","commonSituations":"Running the dnd kitten in drag-source mode with no file paths, or a terminal that incorrectly requests uri-list data from a text-only drag.","solutions":["Pass at least one valid file/directory path when using the kitten as a drag source","Update kitty to eliminate protocol mismatch where the terminal wrongly requests uri-list data","Report upstream if it happens with valid drag sources configured"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate before enabling remote drag: require at least one URI\nif len(uriList) == 0 { return errors.New(\"pass at least one file to drag\") }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass file arguments when dragging as a uri-list source","Check drag_sources[\"text/uri-list\"] is populated before advertising remote capability"],"tags":["dnd","drag-and-drop","uri-list","kitty"],"backgroundTag":"missing-required-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}