{"record":{"id":"1aff7fbc60223c98","repo":"kovidgoyal/kitty","slug":"got-a-remote-data-response-form-the-terminal-witho-1aff7f","errorCode":null,"errorMessage":"got a remote data response form the terminal without a current remote entry","messagePattern":"got a remote data response form the terminal without a current remote entry","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/dnd/drop.go","lineNumber":812,"sourceCode":"}\n\nfunc (dnd *dnd) data_request_completed() {\n\tdnd.drop_status.data_requests.in_flight_count--\n\tif len(dnd.drop_status.data_requests.pending) > 0 && dnd.drop_status.data_requests.in_flight_count < max_inflight_data_rquests {\n\t\tdnd.lp.QueueDnDData(dnd.drop_status.data_requests.pending[0])\n\t\tdnd.drop_status.data_requests.in_flight_count++\n\t\tdnd.drop_status.data_requests.pending = dnd.drop_status.data_requests.pending[1:]\n\t}\n}\n\nfunc (dnd *dnd) on_remote_drop_data(cmd DC) (err error) {\n\tdrop_status := &dnd.drop_status\n\tif drop_status.open_remote_dir == nil {\n\t\treturn fmt.Errorf(\"got a remote data response form the terminal without an open remote dir\")\n\t}\n\tif cmd.X == 0 && cmd.Y == 0 && cmd.Yp == 0 {\n\t\tif drop_status.current_remote_entry == nil {\n\t\t\treturn fmt.Errorf(\"got a remote data response form the terminal without a current remote entry\")\n\t\t}\n\t} else {\n\t\tnum := utils.IfElse(cmd.Yp != 0 && cmd.Yp != 1, cmd.X, cmd.Y) - 1\n\t\tif num < 0 || num >= len(drop_status.open_remote_dir.children) {\n\t\t\treturn fmt.Errorf(\"got a remote data response from the terminal for an entry that does not exist\")\n\t\t}\n\t\tdrop_status.current_remote_entry = drop_status.open_remote_dir.children[num]\n\t}\n\te := drop_status.current_remote_entry\n\tif e.dest == nil {\n\t\te.item_type = cmd.Xp\n\t\tswitch cmd.Xp {\n\t\tcase 0:\n\t\t\tf, err := utils.CreateExclusiveAt(e.base_dir.handle, e.name, 0o666)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\te.dest = f","sourceCodeStart":794,"sourceCodeEnd":830,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/dnd/drop.go#L794-L830","documentation":"A remote drop-data response arrived with zero coordinates (cmd.X==0 && cmd.Y==0 && cmd.Yp==0), meaning 'use the current entry', but drop_status.current_remote_entry is nil because no entry was selected yet.","triggerScenarios":"on_remote_drop_data receives a continuation response before any entry was set as current — protocol misuse or state desync between kitten and terminal.","commonSituations":"Version mismatch, responses arriving out of order, or a terminal bug sending continuation frames first.","solutions":["Update kitty to a version with matching kitten/terminal DnD protocol code","Retry the remote drop operation","Report upstream with debug logs if it persists"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func hasCurrentRemoteEntry(ds *drop_status) bool { return ds.current_remote_entry != nil }","tryCatchPattern":"Drop continuation frames that arrive before an entry is selected; re-request the directory listing.","preventionTips":["Ensure an entry is always selected before expecting continuation responses","Use matched versions"],"tags":["dnd","remote-drop","state-desync","kitty"],"backgroundTag":"invalid-state-transition","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}