Commit graph

3488 commits

Author SHA1 Message Date
Kovid Goyal
65cd74bfa0
Cleanup previous PR 2026-03-27 21:36:07 +05:30
Kovid Goyal
801718e38a
Update changelog 2026-03-27 20:11:48 +05:30
Kovid Goyal
4798ccd0d2
Fix completion for edit-in-kitty not including some common text file types 2026-03-27 20:07:55 +05:30
copilot-swe-agent[bot]
24414f6189
Fix scrollbar hit region to account for window margin (issue #9756)
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/eb5869d6-9938-4ff3-87fb-34fe14694d6c

Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
2026-03-27 05:25:06 +00:00
copilot-swe-agent[bot]
215bbf68de
Fix spurious mouse release event during drag out of OS window
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/f4f7b9e7-102b-4af7-aa03-4fb7a85d6ed0
2026-03-26 14:00:57 +00:00
Kovid Goyal
79713b3ddf
Add a FAQ entry about grid size padding 2026-03-26 17:08:29 +05:30
Kovid Goyal
354d0780b2
Re-order FAQ 2026-03-26 17:03:06 +05:30
Kovid Goyal
0c46783f5e
Cleanup previous PR 2026-03-26 10:21:08 +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
9ea5441a2f
... 2026-03-26 09:39:33 +05:30
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
0ddad7474b
Cleanup previous PR 2026-03-25 09:23:29 +05:30
Kovid Goyal
2ce9d575ef
Update changelog 2026-03-24 21:18:42 +05:30
Kovid Goyal
97d3cd889c
Update changelog 2026-03-23 21:43:55 +05:30
copilot-swe-agent[bot]
c2f6fd9155 Expose session_name in kitten @ ls output for each window (fix #9732)
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/98770c1a-7605-4597-a5ce-f27b35315930
2026-03-23 15:21:46 +00:00
copilot-swe-agent[bot]
6b86e7db5d Extend glfwGetKeyboardRepeatDelay() to return both initial delay and repeat interval
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/bde9bf2e-a0dd-4ccd-8385-6a37be1e025f
2026-03-23 11:58:48 +00:00
copilot-swe-agent[bot]
998ee22ecb Add glfwGetKeyboardRepeatDelay() to the GLFW API for X11, Wayland and Cocoa
Co-authored-by: kovidgoyal <1308621+kovidgoyal@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kovidgoyal/kitty/sessions/4765810b-ecf5-4348-ae3a-ff0ff481aaae
2026-03-23 11:46:35 +00:00
Kovid Goyal
503e0a8acf
Cleanup previous PR 2026-03-23 08:54:57 +05:30
Daniel M German
6a3fe6ae01 Command palette: word-level search with multi-token cross-column matching
Implement a word-level scoring engine for the command palette that replaces
the previous FZF-based approach. Query tokens are matched against pre-tokenized
words in each column (key, action, category) with exact, prefix, and
edit-distance scoring. Multiple search terms are supported with cross-column
matching — items matching more tokens rank higher. Compound query tokens
containing delimiters (e.g. mouse_selection) are matched as units.

Add comprehensive tests using a Go builder API instead of raw JSON blobs,
covering single-token, multi-token, partial-match, ranking, mouse binding,
and unmapped action scenarios.

Add documentation for the command palette kitten.
2026-03-22 17:28:28 -07:00
Kovid Goyal
e9661f0f3a
Graphics protocol: Fix crash when handling invalid offset values in graphics compose commands 2026-03-22 21:49:12 +05:30
Kovid Goyal
46eee6e5df
Update changelog 2026-03-22 07:54:51 +05:30
Kovid Goyal
48ab623f59
Graphics protocol: Fix crash when handling invalid PNG image with direct transmission 2026-03-21 17:23:06 +05:30
Kovid Goyal
bd2a5cccfb
More work on dnd protocol 2026-03-21 17:13:19 +05:30
Kovid Goyal
6a71687942
Apply same correction for mid_lines() based chars as well
Also update changelog
2026-03-21 12:09:05 +05:30
copilot-swe-agent[bot]
e55c4468e5
Fix Too many timers bug and snprintf format string bug in DnD protocol
Fixes #9628
2026-03-21 08:41:47 +05:30
Kovid Goyal
b4d57525ea
Only base64 encode payload when needed 2026-03-21 08:41:47 +05:30
Kovid Goyal
17e941a180
Implement finishing of drops 2026-03-21 08:41:47 +05:30
Kovid Goyal
5ad55ec936
Implement drop data transmission 2026-03-21 08:41:47 +05:30
Kovid Goyal
4f404f8c85
Send dropped message 2026-03-21 08:41:47 +05:30
Kovid Goyal
3a30c47942
Get drop status updates working 2026-03-21 08:41:47 +05:30
Kovid Goyal
111b35b6a7
Implement drop leaving window 2026-03-21 08:41:47 +05:30
Kovid Goyal
fba67322d6
Some docs 2026-03-21 08:41:47 +05:30
Kovid Goyal
b0e57b4dce
Send drop move events to child 2026-03-21 08:41:46 +05:30
Kovid Goyal
8d069d3bcd
More dnd protocol docs 2026-03-21 08:41:46 +05:30
Kovid Goyal
5a8132d241
Start and stop accepting drops 2026-03-21 08:41:46 +05:30
Kovid Goyal
2898324047
Start work on DnD protocol 2026-03-21 08:41:46 +05:30
Kovid Goyal
4483a6c110
version 0.46.2 2026-03-21 06:36:04 +05:30
Kovid Goyal
81c3fa71a0
Update changelog 2026-03-20 08:32:26 +05:30
Kovid Goyal
4eaf380c30
Update changelog 2026-03-19 15:36:02 +05:30
Kovid Goyal
0051b7b046
Update changelog 2026-03-19 15:33:03 +05:30
Kovid Goyal
0321ca04f0
Cleanup previous PR
Fix leak of sub view and ensure child window has correct color space
2026-03-17 20:14:02 +05:30
Kovid Goyal
0479962dd7
Update changelog 2026-03-17 14:29:56 +05:30
Kovid Goyal
f2734fcfbd
Cleanup copilot code 2026-03-17 13:39:07 +05:30
Kovid Goyal
f57eb74dbe
Update changelog 2026-03-17 09:31:51 +05:30
Kovid Goyal
8457258f26
... 2026-03-17 09:30:23 +05:30
Kovid Goyal
6704f359a9
Update changelog 2026-03-17 08:57:30 +05:30
Kovid Goyal
ad53a5bdff
Cleanup previous PR 2026-03-17 08:40:56 +05:30
copilot-swe-agent[bot]
25f97f4ce5
Implement on_quit event for global watchers
Fixes #9682
2026-03-17 08:37:30 +05:30
Kovid Goyal
77821f6321
Fix #9679 2026-03-17 08:21:11 +05:30
Kovid Goyal
40f9945ea7
version 0.46.1 2026-03-16 13:20:03 +05:30
copilot-swe-agent[bot]
66ffb6895c
Fix macOS keyboard focus not restored when switching back from another space
Fixes #9665
Fixes #9666
2026-03-15 14:57:46 +05:30
Kovid Goyal
b3b7d0596d
Dont use neighboring tab colors for tab bar margins on translucent OS windows
The colors are rendered semi-transparent which effectively means they blend
with background unlike the neighboring colors and end up not matching
2026-03-15 09:22:43 +05:30
Kovid Goyal
30756bb819
Cleanup previous PR 2026-03-15 08:38:59 +05:30
Kovid Goyal
e72f49952d
Linux: Fix regression that broke drag and drop from GTK applications
Fixes #9656
2026-03-13 20:19:33 +05:30
Kovid Goyal
98931d99b0
Wayland: Fix momentum scrolling not working on compositors that send a stop frame with no axis information
Fixes #9653
2026-03-13 08:47:45 +05:30
Kovid Goyal
5ba3d10471
X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices
Apparently when running under XWayland, we cant rely on libinput to
detect highres scroll devices. Sigh. Linux input is such a disaster.
Dunno if this will break something else, hopefully not.

Fixes #9649
2026-03-12 19:23:41 +05:30
Kovid Goyal
d8af7e2c88
Add an option to control highlighting of moved lines 2026-03-12 12:59:46 +05:30
Kovid Goyal
c78592174d
... 2026-03-12 12:23:58 +05:30
Chang Yu
9f45daf300
Fix bookorat link in integrations.rst 2026-03-11 22:26:17 -07:00
Kovid Goyal
b9d7a661ce
Dont import ctypes unless type checking
ctypes in Python 3.14 is broken on Intel macs. It uses libffi which is
broken on Intel macs without extra security entitlements. At least
com.apple.security.cs.allow-unsigned-executable-memory and possibly
com.apple.security.cs.disable-executable-page-protection

Rather than add these entitlements, we simply do not import ctypes as it
is not actually used on macs anyway.

Fixes #9643
2026-03-12 09:58:49 +05:30
Kovid Goyal
c2447abd30
Update changelog 2026-03-12 09:22:02 +05:30
Kovid Goyal
36810862ed
Update changelog 2026-03-12 08:57:57 +05:30
Kovid Goyal
01104bac65
Fix a regression that broke `kitten update-self`
Fixes #9642
2026-03-12 08:33:20 +05:30
Kovid Goyal
a1e02c8858
... 2026-03-11 21:24:49 +05:30
Kovid Goyal
e64fbe145e
... 2026-03-11 21:24:24 +05:30
Kovid Goyal
121eec48b5
Make the changelog link to options rather than PRs 2026-03-11 21:21:33 +05:30
Kovid Goyal
4ad6d30ab8
Add command palette shortcut to changelog 2026-03-11 21:03:57 +05:30
Kovid Goyal
74f532bd07
Update major changes 2026-03-11 08:53:58 +05:30
Kovid Goyal
0b2f081d40
version 0.46.0 2026-03-11 08:26:12 +05:30
Kovid Goyal
fa2d7a789e
Mention the command palette in the overview docs 2026-03-11 08:24:42 +05:30
Kovid Goyal
06b074d68d
Update changelog 2026-03-09 15:29:39 +05:30
copilot-swe-agent[bot]
551acca0e4
Implement maximize layout action for splits layout
Fixes #9629
Fixes #9630
2026-03-09 15:27:54 +05:30
Kovid Goyal
5722acad4f
remote_control_script: resolve relative paths with respect to kitty config directory
Fixes #9625
2026-03-09 08:35:28 +05:30
Kovid Goyal
50bc3f465e
Cleanup previous PR
Also fix ask kitten not setting window title in modes other than choose
2026-03-05 11:19:40 +05:30
Kovid Goyal
fcdc67a356
Make shift+left click extend the current selection instead of starting a new selection when the mouse is not grabbed by the TUI application
Matches behavior common to most GUI applications and other terminal
emulators. Can be reverted to previous behavior easily.

See https://github.com/kovidgoyal/kitty/discussions/9608
2026-03-05 11:00:43 +05:30
Kovid Goyal
e1a14551fa
Cleanup previous PR 2026-03-05 09:25:10 +05:30
Kovid Goyal
c772b9a078
Add a note about kitty UI mouse features to the docs 2026-03-05 07:59:57 +05:30
Kovid Goyal
baca6acdc7
Document the new command palette 2026-03-03 15:34:10 +05:30
Kovid Goyal
a7480370a4
Cleanup previous PR
Fixes #9587
2026-03-03 13:37:14 +05:30
Kovid Goyal
2b11345d9b
Add border drag based window resizing to the docs 2026-03-03 09:26:02 +05:30
Kovid Goyal
4e76c089d8
Add emacs kitty graphics package to integrations 2026-03-03 09:19:18 +05:30
Kovid Goyal
77ac85f97b
macOS: Fix flicker during OS Window resize
Do not sync rendering to system vsync in out of sequence renders.
2026-03-03 08:51:41 +05:30
Kovid Goyal
d807960684
Update docs to note that tabs can be dragged and dropped 2026-03-02 16:48:43 +05:30
Kovid Goyal
4d0459df95
Update changelog 2026-03-01 11:00:26 +05:30
Kovid Goyal
32d8ebfbb3
Add an option to control dragging to resize windows 2026-02-26 19:07:47 +05:30
Kovid Goyal
d56958f61a
Cleanup previous PR 2026-02-25 19:40:38 +05:30
Anurag
37dc6e82e4 Add timeout option to key mappings 2026-02-24 16:02:07 +05:30
Kovid Goyal
941e85a95e
Note that graphics-protocol is now supported in xterm.js 2026-02-24 08:55:40 +05:30
Kovid Goyal
c03e280128
Text sizing protocol: Fix alignment/cropping issues when rendering text with a fractional scale
Also add some clarifications to the docs for exactly how alignment
operates with fractional scaling.

Fixes #9471
Fixes #9537
2026-02-24 08:45:21 +05:30
Kovid Goyal
38a2633f20
Cleanup previous PR 2026-02-23 19:40:07 +05:30
Kovid Goyal
5cc510dea4
Merge branch 'titlebar-only-wayland' of https://github.com/antoinecellerier/kitty 2026-02-23 19:19:30 +05:30
Kovid Goyal
8df80afa79
URL detection: Allow trailing asterisks in URLs
Fixes #9543
2026-02-23 07:54:47 +05:30
Kovid Goyal
1df89d9448
Cleanup previous PR
Fixes #9463
2026-02-23 07:44:58 +05:30
Kovid Goyal
f91da73b95
Update changelog
Fixes #9296
2026-02-22 06:49:48 +05:30
Kovid Goyal
2e1e89f280
Cleanup previous PR 2026-02-21 21:30:24 +05:30
Kovid Goyal
b3a74cb8f4
Update changelog 2026-02-21 20:58:34 +05:30
Kovid Goyal
05dbe085a5
Note that the Microsoft Terminal now supports the kitty keyboard input protocol 2026-02-17 10:15:38 +05:30
Kovid Goyal
d333095437
Cleanup previous PR 2026-02-16 14:11:00 +05:30
Kovid Goyal
66a9963fe9
Shell integration: Allow sending click events to shells using y co-ordinates relative to prompts
Note that I havent actually tested the implementation, I leave that to
@okapia.

Fixes #9500
2026-02-15 10:12:22 +05:30
Kovid Goyal
be325ccfcb
Update changelog 2026-02-15 09:58:30 +05:30
LazyStability
4504b5febe
feat(sessions): add active-only to goto_session
Allows to specify whether or not to switch only to an active session
2026-02-14 16:23:27 +01:00
Kovid Goyal
55f14aa63b
... 2026-02-13 11:15:41 +05:30
Kovid Goyal
7c7fc4d140
Fix focus_follows_mouse not working during a drag and drop
Fixes #9497
2026-02-13 10:16:11 +05:30
Kovid Goyal
f4ef955e95
Update changelog 2026-02-10 09:57:28 +05:30
Kovid Goyal
524a67d3aa
... 2026-02-09 06:47:31 +05:30
Antoine Cellerier
ef4574ae97 Support hide_window_decorations titlebar-only on Wayland
Hide the CSD titlebar subsurface while keeping shadow borders for
resizing. On SSD compositors (GNOME), forces CSD mode to draw
kitty's own shadows without a titlebar.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-08 19:49:44 +01:00
Kovid Goyal
386a6f14f0
Add bookorat to integrations 2026-02-08 15:36:15 +05:30
Kovid Goyal
1103aaf1a5
Cleanup previous PR
Testing is_local_file is insufficient since it can be false for local
files that dont have r/w permissions. Instead check if the child is
remote when the EditCmd is created and only use disconnected abort
if child was remote at creation but is not remote currently.
2026-02-08 07:57:15 +05:30
Robert MacLean
35ec8b81ac
Add Warp terminal to keyboard protocol documentation 2026-02-06 08:22:15 +02:00
Kovid Goyal
d02cd59e38
Add far2l to integrations
Fix #9478
2026-02-06 09:31:24 +05:30
Kovid Goyal
625e984b12
Fix line-at-once selection not extending wrapped lines into scrollback
Fixes #9437
2026-01-30 20:29:33 +05:30
Kovid Goyal
59a7a5df63
Note that xterm.js added support for the kitty keyboard protocol 2026-01-27 08:37:55 +05:30
Kovid Goyal
ccefeb05ff
Update changelog 2026-01-26 13:29:44 +05:30
copilot-swe-agent[bot]
027b73db64
Add momentum scrolling for X11 backend
Fixes #9421
2026-01-26 11:51:57 +05:30
Kovid Goyal
9cef9e90f2
Python min version is tracked in pyproject.toml 2026-01-26 11:50:08 +05:30
Kovid Goyal
a5433b8994
kitten choose-files: Add a new binding of Alt+Enter to modify the name of an existing file when choosing a save file name
Fixes #9387
2026-01-26 11:50:08 +05:30
Kovid Goyal
10273d5aa2
kitten @: Fix relative paths for --password-file being resolved relative to CWD instead of the kitty config directory 2026-01-25 20:30:11 +05:30
Kovid Goyal
be0dd00606
icat kitten: When catting multiple images display the images in input order
Fixes #9413
2026-01-24 14:16:54 +05:30
Kovid Goyal
dbcd31f22e
... 2026-01-22 13:13:32 +05:30
Kovid Goyal
391b9c9c80
Merge branch 'update-symbol-map' of https://github.com/rivenirvana/kitty 2026-01-22 09:47:23 +05:30
Arvin Verain
c573050909
docs: Update recommended symbol_map for Nerd Fonts 2026-01-22 08:26:13 +08:00
Arvin Verain
2199927cf1
docs: Small nits and fixes
- Fix unsetting var
- Use actual b64 value for 1
- Other small fixes for clarity
2026-01-22 08:19:41 +08:00
Arvin Verain
f68bb678f4
docs: Remove outdated note
cd72f2d9cf
2026-01-22 00:13:41 +08:00
Kovid Goyal
f6aedde7c2
Fix desktop-ui kitten configuration docs not shown 2026-01-21 10:24:23 +05:30
Kovid Goyal
a88cb2d14d
Fix horizontal alignment of emoji incorrect becase rendered_width was not being set after switching to using cairo to render them
Fixes #9395
2026-01-20 20:01:20 +05:30
Kovid Goyal
a53d5b2fae
Update changelog
Fixes #3732
2026-01-20 17:26:31 +05:30
Kovid Goyal
9ef934cf54
Wayland: Remove usage of the Wayland color management protocol to inform compositors of the color space used by kitty
As is typical with Wayland, the protocol is poorly designed and
implemented even worse. Hyprland 0.53 has completely broken color
management.
https://github.com/hyprwm/Hyprland/discussions/12788
In addition it and mangowc crash when using color management with nouveau drivers.
https://github.com/kovidgoyal/kitty/issues/9030

KDE kwin does not support the sRGB transfer function. And the geniuses
at Wayland are any way planning to deprecate sRGB as a transfer function.

Only GNOME mutter seems to get it right.

Then there are people that are likely going to shoehorn this into EGL
instead of leaving it under application control via the protocol anyway.
https://github.com/KhronosGroup/EGL-Registry/issues/197

Sigh. Wayland.
2026-01-15 09:53:09 +05:30
Kovid Goyal
d35c786358
Bump imaging to fix #9376 2026-01-15 09:13:02 +05:30
Kovid Goyal
c389f4d5b8
Wayland: Fix doubled key repeat events when compositor sends repeat events
Fixes #9374
2026-01-15 08:13:37 +05:30
Kovid Goyal
edd466e5f7
Pygments does not need type checking globally ignored anymore 2026-01-14 22:18:11 +05:30
Kovid Goyal
0cca5d1a10
Only update tab bar visibility after all tabs have been added from a session
Fixes #9382
2026-01-14 21:11:07 +05:30
Kovid Goyal
21da5350d3
Update changelog 2026-01-09 17:22:26 +05:30
Kovid Goyal
2ab0fcb373
Make Wayland momentum scrolling configurable 2026-01-09 13:46:49 +05:30
Kovid Goyal
3637e31ca3
Fix goto_session not respecting the focus_tab session directive when creating a session in an existing OS window
Fixes #9366
2026-01-08 20:43:38 +05:30
Kovid Goyal
d6cb5c367e
Remove warning about multiple cursors protocol being under discussion
It is no longer under discussion
2026-01-08 14:51:05 +05:30
Kovid Goyal
da45f7eeaa
Clenaup previous PR
Make pixel scrolling the default. Fix memory leak where blank line was
not being deallocated in Screen destructor.
2026-01-08 11:01:34 +05:30
Kovid Goyal
0168d19e57
Merge branch 'feat/scroll-per-pixel' of https://github.com/idelice/kitty 2026-01-08 09:12:34 +05:30
Kovid Goyal
df17142ea4
Fix #9355 2026-01-06 08:37:24 +05:30
Kovid Goyal
e1199bcee2
Initial implementation of momentum for finger based scrolling on Wayland
Needs configuration and possibly the parameter adjustment once pixel
scrolling is merged.
2026-01-05 19:52:44 +05:30
Kovid Goyal
e11e1ba929
... 2026-01-03 00:35:12 +05:30
Kovid Goyal
388388381d
ncurses is even worse than I thought it was 2026-01-03 00:32:43 +05:30
Kovid Goyal
ba389d68b9
macOS: Fix changes to macos_titlebar_color while in full screen not being applied after exiting fullscreen
Fixes #9350
2026-01-03 00:19:03 +05:30
Kovid Goyal
5375ca671c
Update changelog 2026-01-01 23:12:38 +05:30
Kovid Goyal
573bfb688a
Move parsing of colors fully into C
Uses a perfect hash function for color name lookup
2025-12-31 14:21:45 +05:30
Kovid Goyal
4773ac81b6
Fix warning from sphinx 2025-12-30 13:23:46 +05:30
Kovid Goyal
62d5fcc074
Merge branch 'wide-gamut-colors' of https://github.com/jokull/kitty 2025-12-30 13:19:44 +05:30
Kovid Goyal
74c67d2253
... 2025-12-29 12:12:27 +05:30
Kovid Goyal
95c1f5aca5
Ensure tabs bar visibility is updated when switching active tab as well
Visibility can change if tab_bar_filter is used and active tab is
changed. See #9328
2025-12-28 10:01:50 +05:30
Jökull Sólberg
64abd87a9e Add wide gamut color support with OKLCH and LAB formats
Implements modern wide gamut color formats with CSS Color Module Level 4
gamut mapping, addressing PR feedback with Go implementation, performance
benchmarks, and reorganized documentation.

Features:
- OKLCH (perceptually uniform color space)
- CIE LAB (device-independent color space)
- CSS Color 4 compliant gamut mapping algorithm
- Inline comment support in color config parsing

Addressing PR Feedback:

1. Go Implementation (tools/utils/style/):
   - Complete OKLCH and LAB parsing with gamut mapping
   - Matches Python implementation structure
   - Comprehensive test suite (all tests passing)
   - Performance benchmarks showing acceptable overhead

2. Performance Benchmarks:
   - OKLCH: ~4.6 µs/op
   - LAB: ~1.5 µs/op
   - 10 mixed colors: ~13 µs total
   - Typical config (50 colors): <0.5ms startup impact

3. Documentation Reorganization:
   - Moved detailed color docs to docs/wide-gamut-colors.rst
   - Configuration docs now link to separate documentation
   - Reduces size of main configuration documentation

Gamut Mapping:
- Binary search chroma reduction from CSS Color Module Level 4
- Preserves lightness and hue while reducing chroma for out-of-gamut colors
- Uses deltaE OK (JND threshold: 0.02) for perceptual difference
- Ensures graceful degradation on sRGB displays

Python Implementation:
- parse_oklch(): OKLCH color parsing with gamut mapping
- parse_lab(): CIE LAB parsing with gamut mapping via OKLCH conversion
- lab_to_oklch(): LAB to OKLCH conversion for consistent gamut mapping
- oklch_to_srgb_gamut_map(): CSS Color 4 gamut mapping algorithm
- srgb_to_oklab(): Reverse conversion for deltaE calculations
- deltaE_ok(): Perceptual color difference in OKLab space

Go Implementation:
- colorspaces.go: All color space conversions and gamut mapping
- wrapper.go: ParseColor() updated to support OKLCH and LAB
- Comprehensive test coverage with benchmarks
- Matches Python implementation behavior

Robustness:
- NaN and infinity validation in all color parsing functions
- Defense-in-depth with validation at parsing and gamut mapping levels
- Returns None/error for invalid input (consistent error handling)
- Validates before clamping operations to prevent NaN propagation

Files changed:
- Python: kitty/rgb.py, kitty_tests/datatypes.py (+250 lines)
- Go: tools/utils/style/colorspaces.go, wrapper.go (+350 lines, tests)
- Docs: docs/wide-gamut-colors.rst (moved from inline)
- Config: kitty/options/definition.py (simplified, links to docs)

References:
- CSS Color Module Level 4: https://www.w3.org/TR/css-color-4/
- OKLCH Color Space: https://bottosson.github.io/posts/oklab/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-27 14:34:34 +00:00