Commit Graph

17993 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
e8e2b31182 Fix memory safety issues, protocol bugs, and add tests for DnD implementation
Fixes:
- Memory leak: drag_free_remote_item now frees children array
- Memory leak: drag_free_offer now frees pending data
- Memory leak: toplevel_data_for_drag frees old URI string before replacement
- Protocol bug: drag_notify missing OSC prefix in escape code output
- Protocol bug: drag_notify missing colon separators between metadata keys
- Buffer overflow: add_payload symlink case ensures capacity for null terminator
- Integer overflow: expand_rgb_data uses size_t casts for multiplication
- Memory leak: realloc anti-pattern fixed in 7 locations (drop_register_window,
  drop_dispatch_data, drag_add_mimes, drag_add_pre_sent_data, drag_add_image,
  add_payload default case, queue_payload_to_child)
- UB: queue_payload_to_child guards memcpy with NULL source + 0 count

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3c7e550c-e8e8-413e-a54b-87d61cb8e574

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-14 09:33:23 +00:00
Kovid Goyal
fc162e8793 Bump python for CVEs 2026-04-14 14:11:35 +05:30
Kovid Goyal
8697da9e2a Merge branch 'feature/support-ssh-remote-command' of https://github.com/zzhaolei/kitty
Fixes #3988
2026-04-14 12:53:34 +05:30
zhaolei
b86367483f Asynchronously read ssh configuration 2026-04-14 14:29:18 +08:00
Kovid Goyal
e455b29a85 Ensure tmpdir used for remote drag is deleted on kitty exit 2026-04-14 11:27:55 +05:30
Kovid Goyal
bcae760ea7 Skeleton for dnd kitten 2026-04-14 11:20:30 +05:30
Kovid Goyal
4076c43783 Report missing pointer-gestures protocol 2026-04-14 09:44:48 +05:30
Kovid Goyal
95593ef008 Wayland: Allow holding momentum scroll by putting two finger on touchpad. Fixes #9863 2026-04-14 09:39:57 +05:30
zhaolei
9b02a59c4e Add support for RemoteCommand option in kitten ssh 2026-04-14 11:11:51 +08:00
Kovid Goyal
549d7d23f6 Merge branch 'copilot/move-dnd-testing-infrastructure' of https://github.com/kovidgoyal/kitty 2026-04-14 08:18:41 +05:30
copilot-swe-agent[bot]
efb4eeab50 move DnD testing infrastructure from glfw.c to dnd.c, add init_dnd()
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/78192f4b-c0b7-4c34-9073-4ea717b531da

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-14 02:12:18 +00:00
Kovid Goyal
6218a09a5b DRYer 2026-04-13 21:50:58 +05:30
Kovid Goyal
5ebca59847 Merge branch 'copilot/validate-drag-drop-implementation' of https://github.com/kovidgoyal/kitty 2026-04-13 21:41:26 +05:30
copilot-swe-agent[bot]
519fd49ce6 Fix bugs in t=k remote drag implementation and add comprehensive tests
Bug fixes in dnd.c:
- mktempdir_in_cache: add missing 'return ans' after successful strdup
- mktempdir_in_cache (utils.py): use O_RDONLY instead of O_RDWR for directories
- remote_items allocation: use mi.num_uris instead of ds.num_mimes
- Off-by-one: uri_item_idx > changed to >= for bounds checks
- Off-by-one: entry_num > changed to >= for bounds checks
- populate_dir_entries: fix missing last entry after final null separator
- add_payload directory finalization: create directory on disk with mkdirat
- get_errno_name: add EFBIG, EISDIR, ENOSPC error codes

Test infrastructure:
- Add dnd_test_force_drag_dropped() to simulate DROPPED state
- Make notify_drag_data_ready() succeed in test mode

Comprehensive t=k tests added:
- Single file, empty file, single symlink transfer
- Chunked file transfer with m=1
- Single directory with children
- Directory with symlinks
- Multiple URIs
- Deep directory trees (breadth-first and depth-first, 3+ levels)
- Mixed file/dir/symlink at top level
- Completion signal
- Error handling (client errors, invalid state)
- DoS limits (REMOTE_DRAG_LIMIT, PRESENT_DATA_CAP)
- Invalid input (bad base64, too large chunks, invalid indices/handles)
- URI list with comments
- Multiple chunks for directory listing

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/9da0bff7-6a1a-490f-a4c5-8cb328e056ce

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-13 15:54:34 +00:00
copilot-swe-agent[bot]
2018f8b134 Fix 4 bugs in t=k implementation and add test infrastructure
Bug 1: remote_items allocation used ds.num_mimes instead of mi.num_uris
Bug 2: Off-by-one in uri_item_idx > mi.num_uris (should be >=)
Bug 3: Off-by-one in entry_num > parent->children_sz (should be >=)
Bug 4: DRAG_SOURCE_DROPPED state never set in drag_notify

Also add dnd_test_force_drag_dropped() helper and make
notify_drag_data_ready() succeed in test mode.

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/9da0bff7-6a1a-490f-a4c5-8cb328e056ce

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-13 15:21:20 +00:00
Kovid Goyal
6bd41c94a2 Make the data transfer limits mutable for use in testing 2026-04-13 20:20:25 +05:30
Kovid Goyal
4942ac98a1 More work on DnD protocol 2026-04-13 19:40:23 +05:30
Kovid Goyal
77512086df ... 2026-04-13 13:58:00 +05:30
Kovid Goyal
c60ed85cdd Merge branch 'dependabot/go_modules/all-go-deps-ec1cff6765' of https://github.com/kovidgoyal/kitty 2026-04-13 09:15:06 +05:30
dependabot[bot]
e150c8a49a Bump golang.org/x/sys from 0.42.0 to 0.43.0 in the all-go-deps group
Bumps the all-go-deps group with 1 update: [golang.org/x/sys](https://github.com/golang/sys).


Updates `golang.org/x/sys` from 0.42.0 to 0.43.0
- [Commits](https://github.com/golang/sys/compare/v0.42.0...v0.43.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-version: 0.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all-go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 03:43:18 +00:00
Kovid Goyal
5d2dea4a62 Re-organise code 2026-04-12 14:46:29 +05:30
Kovid Goyal
9354a334fd More spelling errors 2026-04-12 12:55:01 +05:30
Kovid Goyal
3d0a34254a ... 2026-04-12 12:52:57 +05:30
Kovid Goyal
916173dcb3 Improve machine id docs formatting 2026-04-12 12:46:49 +05:30
Kovid Goyal
f81111245e ... 2026-04-12 12:42:06 +05:30
Kovid Goyal
7d952776cb ... 2026-04-12 12:33:18 +05:30
Kovid Goyal
59cf34ca58 Get machine_id working on macOS as well 2026-04-12 12:31:42 +05:30
Kovid Goyal
ccbe5d7db3 ... 2026-04-12 11:47:49 +05:30
Kovid Goyal
078d241914 Merge branch 'copilot/improve-drag-and-drop-functionality' of https://github.com/kovidgoyal/kitty 2026-04-12 11:40:36 +05:30
copilot-swe-agent[bot]
d7fcf30250 Improve mouse-demo DnD: region-only drops, file sizes, remote file support
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/df38243b-dc36-470c-bb8f-e1e8162bb1ab

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-12 05:58:10 +00:00
Kovid Goyal
864ef70484 Have the client send machine id to terminal rather than vice versa
The terminal is the trusted by user party here.
2026-04-12 11:00:23 +05:30
Kovid Goyal
9ebe692bf7 Allow drop clients to use machine id as well 2026-04-12 09:27:16 +05:30
Kovid Goyal
88a4d90daa ... 2026-04-11 22:05:01 +05:30
Kovid Goyal
e53bad9fc2 More work on DnD protocol 2026-04-11 21:52:07 +05:30
Kovid Goyal
36237f3bd0 Cleanup previous PR 2026-04-11 20:46:11 +05:30
Kovid Goyal
5b4ccff5bd Merge branch 'copilot/implement-parse-uri-list-function' of https://github.com/kovidgoyal/kitty 2026-04-11 20:40:08 +05:30
copilot-swe-agent[bot]
f6b999efdd Implement parse_uri_list() in dnd.c per RFC 2483
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/06c06ea3-b5d0-4f78-b319-380af08bb139

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-11 15:07:08 +00:00
Kovid Goyal
aa57cef9ed More work on DnD protocol 2026-04-11 20:26:38 +05:30
Kovid Goyal
ba95be8303 More work on DnD protocol 2026-04-11 19:45:03 +05:30
Kovid Goyal
df20d4aa7c Add machine id and stub for t=k transfers 2026-04-11 17:20:53 +05:30
Kovid Goyal
cfa9f1bada Bump dependencies for CVEs 2026-04-11 14:29:23 +05:30
copilot-swe-agent[bot]
74c3bbe06d Implement software rendering for Unicode 16 legacy computing symbols
Add rendering for codepoints U+1FBCE-U+1FBEF, U+1CC1B-U+1CC3F,
and U+1CE16-U+1CE19 in decorations.c with registration in fonts.c
and test coverage in kitty_tests/fonts.py.

Characters implemented:
- U+1FBCE-1FBCF: Left two-thirds and one-third blocks
- U+1FBD0-1FBDF: 16 diagonal box drawing characters
- U+1FBE0-1FBE3: Justified half white circles (outlines)
- U+1FBE4-1FBE5: Upper/lower centre quarter blocks
- U+1FBE8-1FBEB: Justified half black circles (filled)
- U+1FBEC-1FBEF: Justified quarter black circles (filled)
- U+1CC1B-1CC1E: Box drawing variants with offset junctions
- U+1CC1F-1CC20: Double diagonal lines
- U+1CC30-1CC3F: Twelfth and quarter circle arcs
- U+1CE16-1CE19: Box drawings light vertical T-junctions

Fixes #9851
2026-04-11 14:17:21 +05:30
Kovid Goyal
26388c6bbf Update changelog 2026-04-11 10:08:44 +05:30
Kovid Goyal
4c6f45e4ce Merge branch 'copilot/implement-missing-block-elements' of https://github.com/kovidgoyal/kitty 2026-04-11 10:08:13 +05:30
copilot-swe-agent[bot]
5f01076daa Fix comment in draw_separated_block
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/0e5a33d1-c34e-4e8a-b161-7469ab770c05

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-11 04:28:28 +00:00
copilot-swe-agent[bot]
76c76381b8 Add missing block elements from Unicode Symbols for Legacy Computing Supplement
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/0e5a33d1-c34e-4e8a-b161-7469ab770c05

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-11 04:24:29 +00:00
Kovid Goyal
564c964ed0 Add remote drag protocol
Needs to be implemented.
2026-04-10 20:32:53 +05:30
Kovid Goyal
01055d36b0 Move roundtrip on exit flag into terminal options to have a consistent API 2026-04-10 15:37:20 +05:30
Kovid Goyal
3fe884a29a DRYer 2026-04-10 15:32:27 +05:30
Kovid Goyal
5e158f90a7 Fix some responses from terminal sometimes leaking into shell on after kitten exit
Always do a roundtrip at kitten exit, except for special purpose
kittens. This slows down exit by one round trip time (capped at 2
seconds), however it ensures that we never get terminal response leak.

Fixes #9839
2026-04-10 15:14:38 +05:30