Commit Graph

18023 Commits

Author SHA1 Message Date
Kovid Goyal
f8dd59ebb0 Loop callback for dnd escape codes 2026-04-16 20:47:16 +05:30
Kovid Goyal
5ea424abeb Loop API for DnD transmission 2026-04-16 20:06:12 +05:30
Kovid Goyal
b16d199c54 ... 2026-04-16 19:24:21 +05:30
Kovid Goyal
0e41c937ac More modernization 2026-04-16 19:15:19 +05:30
Kovid Goyal
c3d1665fa6 run go modernizer 2026-04-16 19:12:31 +05:30
Kovid Goyal
9b406c21ff Make CodeQL happy 2026-04-16 15:30:21 +05:30
Kovid Goyal
8a61dbeee0 Micro optimisation 2026-04-16 15:03:44 +05:30
copilot-swe-agent[bot]
69c608c70f Add tests for watch_for_kitty_config_changes Go function
Fixes #9882
2026-04-16 14:55:34 +05:30
Kovid Goyal
e9f3844f64 Implement auto reload of config 2026-04-16 14:41:29 +05:30
Kovid Goyal
efbfbb49f9 Use a single go routine to watch all dirs 2026-04-16 12:53:53 +05:30
Kovid Goyal
aa0a415500 Parse config files to determine set of dirs to watch 2026-04-16 12:49:48 +05:30
Kovid Goyal
80ad647336 Start work on config watcher kitten 2026-04-16 12:37:43 +05:30
Kovid Goyal
a4608c77a6 Update changelog 2026-04-16 08:49:26 +05:30
Kovid Goyal
cbc23d948d Merge branch 'copilot/fix-issue-9725-cursor-data' of https://github.com/kovidgoyal/kitty
Fixes #9725
2026-04-16 08:47:41 +05:30
copilot-swe-agent[bot]
09e10fea85 Fix stale is_selected buffer after screen buffer toggle (#9725)
When toggling between alt and main screen buffers, the selection buffer
(is_selected) was not always re-uploaded to the GPU. This caused a size
mismatch because render_lines_for_screen depends on pixel_scroll_enabled,
which depends on linebuf == main_linebuf.

On alt screen, pixel_scroll is disabled so render_lines = screen->lines.
On main screen, pixel_scroll is enabled so render_lines = screen->lines + 1.
After switching from alt to main, the cell data buffer was re-uploaded with
the larger size (is_dirty = true), but the selection buffer was not
(screen_is_selection_dirty could return false if no selections/urls/extra
cursors were active). The extra row of cells then read out-of-bounds from
the selection buffer, getting garbage data that the shader interpreted as
extra cursor shapes, producing blinking cursor-colored artifacts.

Fix by unconditionally setting extra_cursors.dirty = true after screen
toggle, ensuring the selection buffer is always re-uploaded with the
correct size matching the cell data buffer.

Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/daa73124-4795-4389-aea5-bb5593a26d9f

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-16 03:13:25 +00:00
copilot-swe-agent[bot]
a348cabe23 Skip generation increment in background_images() when paths unchanged 2026-04-16 08:13:14 +05:30
Kovid Goyal
12a87929c6 Fix various minor bugs in the multiple bgimage code 2026-04-15 23:02:11 +05:30
Kovid Goyal
df4d3218a3 ... 2026-04-15 22:43:48 +05:30
Kovid Goyal
2c9541cf21 Allow preloading multiple background images to GPU for fast switching
Fixes #9836
2026-04-15 22:34:20 +05:30
Kovid Goyal
92262ca095 Merge branch 'feat/ls-tab-activity' of https://github.com/muchzill4/kitty 2026-04-15 17:37:25 +05:30
Bartek Mucha
0aa5d32f5f Don't replicate data on tabs 2026-04-15 12:59:04 +01:00
Bartek Mucha
f711e55a22 Expose window activity state in the kitty @ ls 2026-04-15 09:54:24 +01:00
Kovid Goyal
fc1a17062e ... 2026-04-15 10:11:39 +05:30
Kovid Goyal
b24425a1fd ... 2026-04-15 08:04:02 +05:30
Kovid Goyal
f65438d6a5 Improve performance of using active process data when rendering the tab bar by only scanning processes once per second
We dont bother with configurable ttl. Instead treat the start of caching
as the instant when cache freshness is checked. And ensure that cache is
re-used for every OS Window.

Fixes #9862
Fixes #9872
2026-04-15 07:53:09 +05:30
Kovid Goyal
15a6a51a22 Fix RemoteCommand usage with bootstrap.py and bootstrap.sh not exiting after RemoteCommand 2026-04-15 05:37:56 +05:30
Kovid Goyal
a47093a7bf ssh kitten: Fix -o RemoteCommand handling 2026-04-15 05:19:22 +05:30
Kovid Goyal
a9e56d52a0 Merge branch 'copilot/fix-memory-leaks-and-add-tests' of https://github.com/kovidgoyal/kitty 2026-04-14 17:47:00 +05:30
Kovid Goyal
5e8ca630d4 ... 2026-04-14 17:39:04 +05:30
copilot-swe-agent[bot]
48523efc7f Add null check for strdup in dnd_test_drag_notify
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:37:36 +00:00
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