Commit Graph

1388 Commits

Author SHA1 Message Date
Kovid Goyal
64342abda0 More work on the dnd kitten 2026-04-23 08:15:34 +05:30
Kovid Goyal
b4f7162a73 Use CLOEXEC with openat 2026-04-21 22:01:39 +05:30
Kovid Goyal
43035b7224 Rename at fd module 2026-04-21 21:59:05 +05:30
Kovid Goyal
828384a324 More fd based API 2026-04-21 21:58:33 +05:30
Kovid Goyal
b8de27655f Utility function to delete content of dir pointed to by open file 2026-04-21 21:41:17 +05:30
Kovid Goyal
1ca6dba7e1 ... 2026-04-21 13:12:45 +05:30
Kovid Goyal
3d8a2fbb4f Use SIMD base64 everywhere 2026-04-21 11:56:55 +05:30
Kovid Goyal
744ad7438c Use SIMD base64 encoding for graphics transmission 2026-04-21 10:01:28 +05:30
Kovid Goyal
93573aec6f Switch to SIMD based base64 decoder 2026-04-21 09:52:39 +05:30
Kovid Goyal
1b741ca725 Clean up API of streaming decoder 2026-04-21 09:49:09 +05:30
copilot-swe-agent[bot]
7b346d15c1 Add comprehensive tests for streaming_base64 decoder
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/b5dbc339-6907-46fb-a7e7-9ee08b7ed20d

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-21 04:13:30 +00:00
Kovid Goyal
94651eaff2 Go version of streaming base64 decoder 2026-04-21 09:34:25 +05:30
Kovid Goyal
4e04e34438 Refactor dnd cmd queueing API 2026-04-19 22:54:44 +05:30
Kovid Goyal
0ddbffdf79 Allow mocking remote clients 2026-04-19 20:42:43 +05:30
Kovid Goyal
36171d1233 More work on dnd kitten 2026-04-19 10:21:01 +05:30
copilot-swe-agent[bot]
2e314ecba9 Rewrite mouse-demo drop to use OnDnDData API; fix QueueDnDData bugs
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3359d812-5cb2-44a6-ae6e-ba1d708c490a

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-16 15:32:49 +00:00
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
2c9541cf21 Allow preloading multiple background images to GPU for fast switching
Fixes #9836
2026-04-15 22:34:20 +05:30
Kovid Goyal
bcae760ea7 Skeleton for dnd kitten 2026-04-14 11:20:30 +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
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
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
Kovid Goyal
950497ac0c Cleanup previous PR 2026-04-03 22:25:05 +05:30
z3rco
b39f88c6a2 Fix multiple security vulnerabilities across C, Python, and Go code
Timing-safe comparisons:
- crypto.c: Replace memcmp with CRYPTO_memcmp for Secret equality,
  require equal lengths before comparing
- remote_control.py: Constant-time password lookup to avoid leaking
  valid passwords via dict hash timing
- file_transmission.py: Use hmac.compare_digest for bypass token
  comparison instead of ==

Memory safety:
- child-monitor.c: Fix inverted condition in write_to_peer that
  prevented memmove from ever executing on partial writes
- ibus_glfw.c: Null-terminate IBUS_ADDRESS copy to prevent string
  overread when strlen >= PATH_MAX
- x11_window.c: Add NULL checks after realloc in clipboard/DnD
  data handling (two sites)
- dnd.c: Cap accepted_mimes at 1MB to prevent unbounded growth,
  fix realloc to not lose the original pointer on failure
- png-reader.c: Cast to size_t before multiplication to prevent
  integer overflow on 32-bit platforms

Secrets hygiene:
- disk-cache.c: Zero encryption_key with explicit_bzero before free

Tar extraction hardening:
- tar.go: Validate hardlink targets against destination prefix to
  prevent writing outside extraction directory
- tar.go: Strip setuid/setgid/sticky bits from extracted files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 16:10:46 +01:00
copilot-swe-agent[bot]
1853c48561 tui/password: make lock emoji blink at 500ms via repeating timer
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/3ee6840f-29cc-43bb-a4b6-bf9ae604ea11

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-01 02:51:40 +00:00
copilot-swe-agent[bot]
8aa83221e8 Improve password input: hide cursor and show lock emoji (U+1F512)
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/cf06c199-5837-41da-bebf-eb3c220684db

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-04-01 02:43:55 +00:00
Jake Stewart
1a62cde212 Add option to generate 256 color palette from first 16 colors
Needs more work to test and possibly implement reporting and setting
of the nullable color table colors.

Fixes #9426
2026-03-27 20:01:14 +05:30
copilot-swe-agent[bot]
6a0efbfdba Refactor ShortcutTracker.Match() to respect AllowFallback priority order
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/85fbf706-4688-4901-9a23-907cebc91da3
2026-03-26 04:31:37 +00:00
Kovid Goyal
88ee80b327 Cleanup previous PR
Actually respect the fallback order when finding matching shortcuts
2026-03-26 09:30:14 +05:30
Павел Мешалкин
8ffdf7d7ee feat: add per-mapping --allow-fallback for layout-independent shortcuts
Add --allow-fallback option to the map command that controls shifted
and ascii (alternate_key) fallback for individual key mappings.

For non-Latin keyboard layouts, when the current layout key is
non-ascii (codepoint > 127 and < 0xE000), the alternate_key from
the base layout is used for matching if the mapping opts in via
--allow-fallback=shifted,ascii.

Default kitty bindings use --allow-fallback=shifted,ascii so they
work out of the box with non-Latin layouts. User custom mappings
default to --allow-fallback=shifted (preserving existing shifted_key
behavior without ascii fallback).

--allow-fallback=none disables all fallback for a mapping.

Python side: parse_options_for_map() in options/utils.py handles flag
parsing, ShortcutMapping uses it in __init__. get_shortcut() filters
candidates by per-mapping allow_fallback.

Go side: ParseMap() handles --allow-fallback, KeyAction stores
AllowFallback, ShortcutTracker.Match passes it to matching.
MatchesParsedShortcut defaults to shifted,ascii for hardcoded shortcuts.

Migrated kittens (themes, command_palette, diff, choose_files) to
use ShortcutTracker with configurable map entries.

Tests added for Python (5 test methods) and Go (ParseMap + key matching).
2026-03-25 19:34:13 +03:00
Kovid Goyal
59117ff5fd ... 2026-03-21 08:41:48 +05:30
Kovid Goyal
27ad4bc070 Fix some more misc bugs in the DnD code 2026-03-21 08:41:48 +05:30
Kovid Goyal
1704d27004 ... 2026-03-21 08:41:47 +05:30
Kovid Goyal
eddaaed3e3 Modernize Go code 2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
3d13cf1ca5 Fix three bugs in mouse demo kitten DnD drop handling
Fixes #9631
2026-03-21 08:41:47 +05:30
copilot-swe-agent[bot]
9ee058eaf9 Initial implementation of drop client in mouse_demo
Fixes #9623
2026-03-21 08:41:47 +05:30