{"record":{"id":"92e2922b1546400f","repo":"kovidgoyal/kitty","slug":"got-a-remote-data-response-form-the-terminal-witho","errorCode":null,"errorMessage":"got a remote data response form the terminal without an open remote dir","messagePattern":"got a remote data response form the terminal without an open remote dir","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/dnd/drop.go","lineNumber":808,"sourceCode":"\t\tdnd.drop_status.data_requests.in_flight_count++\n\t} else {\n\t\tdnd.drop_status.data_requests.pending = append(dnd.drop_status.data_requests.pending, cmd)\n\t}\n}\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)","sourceCodeStart":790,"sourceCodeEnd":826,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/dnd/drop.go#L790-L826","documentation":"The kitten received a remote drop-data response from the terminal while drop_status.open_remote_dir is nil, i.e. no remote directory drop is in progress. This indicates a protocol/state desync or an unexpected response.","triggerScenarios":"on_remote_drop_data(cmd) is called via on_drop_data (root_remote_dir != nil) but open_remote_dir was never set — e.g. the open-dir request failed or was reset before the response arrived.","commonSituations":"Terminal/kitten version mismatch, late response arriving after the drop was aborted, or a bug in remote directory traversal state management.","solutions":["Update kitty so kitten and terminal protocol versions match","Retry the drop; a late/stale response after an aborted drop is often transient","Report upstream with --debug-input logs if reproducible"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"func hasOpenRemoteDir(ds *drop_status) bool { return ds.open_remote_dir != nil }","tryCatchPattern":"Ignore stale responses when no remote dir is open (log-and-continue) instead of propagating the error.","preventionTips":["Reset drop state atomically when a remote drop is aborted","Use matched kitten/terminal 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"}