From 9324bd62769b71ea74862d8dabd37d2d32d0fe2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 11 May 2026 17:13:34 +0000 Subject: [PATCH] Fix empty dir double-finalization and remote_item_write_id reset bugs Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/24185546-c2b4-44e6-8649-a06dc6d1491d Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com> --- kittens/dnd/drag.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kittens/dnd/drag.go b/kittens/dnd/drag.go index 2772e6ade..3e441c9a7 100644 --- a/kittens/dnd/drag.go +++ b/kittens/dnd/drag.go @@ -395,7 +395,9 @@ func (dnd *dnd) send_remote_dir(path string, idx_in_uri_list, parent_dir_handle, names = append(names, entry.Name()) } payload := utils.UnsafeStringToBytes(strings.Join(names, "\x00")) - dnd.send_remote_item_payload(parent_dir_handle, idx, idx_in_uri_list, handle, payload) + if len(payload) > 0 { + dnd.send_remote_item_payload(parent_dir_handle, idx, idx_in_uri_list, handle, payload) + } dnd.drag_status.remote_item_write_id = dnd.send_remote_item_payload(parent_dir_handle, idx, idx_in_uri_list, handle, nil) return } @@ -442,6 +444,7 @@ func (dnd *dnd) next_remote_item() (err error) { if len(dnd.drag_status.remote_items) < 1 { // current remote data request finished dnd.drag_status.remote_data_requests = dnd.drag_status.remote_data_requests[1:] + dnd.drag_status.remote_item_write_id = 0 if len(dnd.drag_status.remote_data_requests) > 0 { return dnd.send_next_remote_data_request() }