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
..
__init__.py More work on dnd kitten 2026-05-11 21:51:23 +05:30
atexit.py Add integration test for go atexit implementation 2025-09-30 12:37:25 +05:30
CascadiaCode-Regular.otf
check_build.py Cleanup previous PR 2026-03-15 08:38:59 +05:30
clipboard.py Fix a regression that broke writing to the clipboard using the OSC 5522 protocol 2024-09-15 08:42:50 +05:30
ComfyCode-Regular.ttf Add shaping tests for ligature cases and bundle Comfy Code 2026-04-25 19:43:17 +08:00
command_palette.py Add alias and combine support to the command palette 2026-04-06 09:45:39 -07:00
completion.py remove leftover debug prints 2025-07-20 21:45:36 +05:30
crypto.py
datatypes.py Cleanup previous PR 2026-04-28 16:57:14 +05:30
dnd.py Fix empty file not created when dragging from remote Linux to Finder 2026-05-17 15:31:15 +00:00
dnd_kitten.py Fix failing test 2026-05-17 08:52:28 +05:30
file_transmission.py tests: apply os.utime to created symlinks too 2024-10-03 23:09:28 -04:00
FiraCode-Medium.otf
fonts.py Add tests for glyph_matches_dot_liga_final_component 2026-04-26 16:43:37 +08:00
glfw.py
gr.py
GraphemeBreakTest.json Add support for Unicode 17 2025-10-18 09:59:53 +05:30
graphics.py dd basic drag thumbnail support to dnd kitten 2026-05-03 22:18:18 +05:30
iosevka-regular.ttf
keys.py Cleanup previous PR 2026-03-26 09:30:14 +05:30
layout.py Enhance regression test with additional geometry validity assertions 2026-05-01 15:05:34 +00:00
LiberationMono-Regular.ttf
main.py Bump python version in CI 2026-04-19 21:35:13 +05:30
mouse.py Fix double-click word selection not extending beyond viewport edges 2026-04-07 09:49:50 +00:00
multicell.py Fix crash in overlay line drawing on uninitialized linebuf view 2026-04-18 13:10:07 +08:00
notifications.py Ensure temp files and other resources are cleaned up even if kitty crashes or is SIGKILLed 2025-01-05 12:51:59 +05:30
open_actions.py
options.py pep8 2026-04-24 10:42:25 +05:30
panels.py ... 2025-05-03 10:47:03 +05:30
parser.py Add parse test for CSI 14;2 t 2025-11-24 11:23:21 +05:30
screen.py tests: regression for apply_selection with paused-rendering + scrollback 2026-05-16 17:00:01 +08:00
search_query_parser.py
shell_integration.py Make detection of command line flags that prevent sudo from overriding TERMINFO more robust 2026-05-05 09:38:07 +05:30
shm.py
ssh.py Dont use subTest as it doesnt work with retry_on_failure 2025-04-07 05:22:15 +05:30
tui.py
twemoji_smiley-cff2_colr_1.otf Add basic colrv1 rendering test 2025-02-03 11:06:41 +05:30
utmp.py