Files
kitty/kitty_tests
copilot-swe-agent[bot] 634c078168 Fix empty file not created when dragging from remote Linux to Finder
When dragging an empty file (or a directory containing an empty file)
from a remote Linux machine to macOS Finder, the empty file would not
be copied.

Root cause: in add_payload() in dnd.c, the file is only created with
O_CREAT when payload data arrives. For an empty file, no payload is
ever sent, so the file was never created on disk. When Finder then
tried to hard-link the (non-existent) temp file to the destination, it
failed silently.

Fix: in the "all data received" handler for type 0 (regular file),
check if the fd was ever opened. If not (empty file), create the empty
file explicitly before finishing.

Also add:
- A new test probe drag_remote_item_path:N to retrieve the filesystem
  path of a specific remote item by URI index.
- Two regression tests: test_remote_drag_empty_file (verifying the
  empty file is created on disk) and test_remote_drag_dir_with_empty_file
  (verifying an empty child file inside a directory is created on disk).

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/da8b4577-3de8-4784-afc0-c1967f605dec

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-05-17 15:31:15 +00:00
..
2026-05-11 21:51:23 +05:30
2026-04-28 16:57:14 +05:30
2026-05-17 08:52:28 +05:30
2026-04-24 10:42:25 +05:30