{"record":{"id":"ad0d68e0fff6b54e","repo":"kovidgoyal/kitty","slug":"terminal-responded-with-drag-source-error-s","errorCode":null,"errorMessage":"terminal responded with drag source error: %s","messagePattern":"terminal responded with drag source error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/dnd/drag.go","lineNumber":199,"sourceCode":"\t\tdnd.finish_drag(\"EIO\")\n\t\treturn err\n\t}\n\tdnd.lp.QueueDnDData(DC{Type: 'P', X: -1}) // start drag\n\tdnd.drag_status.active = true\n\n\treturn dnd.render_screen()\n}\n\nfunc (dnd *dnd) on_drag_error(cmd DC) (err error) {\n\tpayload := string(cmd.Payload)\n\tswitch payload {\n\tcase \"OK\":\n\t\tif dnd.drag_status.active && !dnd.drag_status.terminal_accepted_drag {\n\t\t\tdnd.drag_status.terminal_accepted_drag = true\n\t\t\terr = dnd.render_screen()\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"terminal responded with drag source error: %s\", payload)\n\t}\n\treturn\n}\n\nfunc (dnd *dnd) reset_drag() {\n\tfor _, dr := range dnd.drag_status.data_requests {\n\t\tif dr.drag_source.file != nil {\n\t\t\tdr.drag_source.file.Close()\n\t\t\tdr.drag_source.file = nil\n\t\t}\n\t}\n\tif dnd.drag_status.current_remote_file != nil && dnd.drag_status.current_remote_file.file != nil {\n\t\tdnd.drag_status.current_remote_file.file.Close()\n\t}\n\tdnd.drag_status = drag_status{}\n}\n\nfunc (dnd *dnd) on_drag_event(x, y, operation int) (err error) {","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/dnd/drag.go#L181-L217","documentation":"The terminal (kitty) replied to the kitten's drag-and-drop protocol handshake with an error payload instead of 'OK'. This means the terminal itself rejected or failed the drag source operation while the dnd kitten was acting as drag source.","triggerScenarios":"Occurs in on_drag_error when the terminal sends a drag-response escape sequence whose payload is not 'OK' — e.g. the terminal does not support the drag protocol, or an internal terminal-side error happened during the drag.","commonSituations":"Running the dnd kitten against an older kitty version that lacks drag-and-drop support, a protocol version mismatch between kitten and terminal, or a terminal-side failure while initiating the drag.","solutions":["Verify you are running the dnd kitten with a kitty version that matches/paths the drag-and-drop protocol (kitty >= 0.42 approximately)","Update kitty to the latest version so kitten and terminal protocol agree","If it persists, report with debug logs (kitten run with --debug-input or kitty --debug-rendering) since the payload string identifies the terminal-side error"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Check the returned error from the dnd entry point; log the payload string after 'drag source error:' — it is the terminal's own diagnostic and identifies the terminal-side cause.","preventionTips":["Keep kitten and kitty terminal versions in sync","Test DnD features after every kitty upgrade"],"tags":["dnd","drag-and-drop","terminal-protocol","kitty"],"backgroundTag":"terminal-protocol-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}