Commit Graph

3241 Commits

Author SHA1 Message Date
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
Kovid Goyal
0fd3a18121 ... 2025-12-24 12:15:16 +05:30
Kovid Goyal
c26b770530 version 0.45.0 2025-12-24 09:24:17 +05:30
Kovid Goyal
ef4e6f97bc ... 2025-12-24 09:19:52 +05:30
Kovid Goyal
df32684afd Update choose files docs 2025-12-24 09:17:24 +05:30
Kovid Goyal
44efa30679 ... 2025-12-23 15:50:55 +05:30
Kovid Goyal
eb43aacb02 Update changelog 2025-12-23 12:25:48 +05:30
alex-huff
59cf17f2be docs: panel: update river compatibility information 2025-12-21 12:17:56 -06:00
Kovid Goyal
e368ce0d52 Fix docs build breakage 2025-12-20 09:13:02 +05:30
Kovid Goyal
5b0b714baa Update changelog 2025-12-20 09:10:39 +05:30
Kovid Goyal
b9e75ac301 Add matplotlib as a requirement for docs 2025-12-20 09:07:19 +05:30
Kovid Goyal
4f73374a12 YATB: Yet Another Tahoe Bug from the company that should stick to selling fruit
Fixes #9299
2025-12-18 11:13:38 +05:30
Matt K
0a0a575a57 add nyancat app icon 2025-12-17 17:10:34 -05:00
Kovid Goyal
322904b339 Update changelog 2025-12-14 20:07:52 +05:30
Kovid Goyal
0ecee7dcca macOS: Workaround for regression in Tahoe 26.2 that breaks --detach
Fixes #9288
2025-12-14 19:42:57 +05:30
shfc
51a08d23cd fix: typos in documentation 2025-12-14 22:42:24 +10:30
Kovid Goyal
399354cbe5 Fix tab_bar_min_tabs not tab_bar_filter
Fixes #9278
2025-12-12 17:11:43 +05:30
Kovid Goyal
94106aa79e Add dawn to the list of integrations 2025-12-12 00:41:41 +05:30
Kovid Goyal
0837fd548d Update changelog 2025-12-11 11:21:43 +05:30
Filip Czaplicki
34776469e0 Optimize quake webp screenshots
I noticed that screenshots load slowly at
https://sw.kovidgoyal.net/kitty/kittens/panel/

I used https://squoosh.app/ with webp default settings
2025-12-07 17:32:33 +01:00
Kovid Goyal
270d3ed656 Note that iTerm2 also added support for the kitty graphics protocol 2025-12-04 22:32:52 +05:30
Kovid Goyal
8e15e14538 When moving windows to a new tab/OS Window fix overlay windows not being grouped with their parent windows
Fixes #9266
2025-12-04 07:49:48 +05:30
Kovid Goyal
16008b950a Wayland: Fix spurious key repeat events when some user defined callback takes a long time to execute
On compositors that support compositor key repeat events, use those, for
complete robustness. Sadly no actual compositor implements these yet.

Otherwise use a timer fd/pipe to queue the repeat events and only
dispatch them after events from the compositor are handled. This means
release events from the compositor will prevent spurious repeat events.
One can, in the worst case lose some repeat events if there is a very
large interval between the start of the timer and the next poll, but
that is unavoidable and is why repeat events should come from the compositor
in the first place.

Fixes #9224
2025-12-03 22:26:09 +05:30
Kovid Goyal
7d24c82d4d Update FAQ to defer to OSC 21 spec for setting colors via escape codes 2025-12-03 20:29:00 +05:30
Kovid Goyal
ff72c79628 Edit docs for typos 2025-12-02 06:26:47 +05:30
Kovid Goyal
20b39ee163 Add a default mapping for searching the scrollback
Opens the scrollback pager in search mode. Particularly useful for
newbies on macOS that are used to using cmd+f to trigger search mode.

If there is a current selection, it is automatically searched for.
2025-12-01 08:10:07 +05:30
Kovid Goyal
6db24b66fa Dont rewrap text in the alternate screen buffer
Avoids flicker during live resize with no resize_debounce_time. See
https://github.com/kovidgoyal/kitty/discussions/9142 for discussion.
2025-11-26 10:29:12 +05:30
Kovid Goyal
9e918547e8 Since d7c2cdc closing an OS Window on macOS was causing minimized window to be restored.
Fixes #8913
2025-11-25 15:38:12 +05:30
Kovid Goyal
3d92a52676 When expanding environment variables in listen_on allow the env directive to take effect 2025-11-25 08:19:51 +05:30
Kovid Goyal
914631b049 Avoid malloc per chunk 2025-11-24 17:39:19 +05:30
Kovid Goyal
c9c1b20cd1 Code golf the python version as well 2025-11-24 15:50:51 +05:30
Kovid Goyal
a2636f1860 Code golf 2025-11-24 15:21:18 +05:30
Kovid Goyal
adf03c067c Add support for OpenBSD as well to transmit_png 2025-11-24 15:08:55 +05:30
Kovid Goyal
1236f04a97 return rather than exit 2025-11-24 11:29:17 +05:30
Kovid Goyal
79cd4d3ee8 ... 2025-11-24 11:28:27 +05:30
Kovid Goyal
701d229139 Dont depend on icat to read screen size in pixels 2025-11-24 10:52:53 +05:30
Kovid Goyal
9fdebd66cb Minor robustness improvements 2025-11-24 10:22:36 +05:30
Kovid Goyal
905e72baa2 ... 2025-11-24 10:20:58 +05:30
Kovid Goyal
a3777694fd POSIX printf doesnt support \e 2025-11-24 10:18:43 +05:30
Kovid Goyal
0d78490cc8 Make the script to transmit PNG image POSIX sh compliant
Fixes #9243
2025-11-24 10:14:34 +05:30
Kovid Goyal
554859cc6e ... 2025-11-24 09:38:25 +05:30
Kovid Goyal
18e73d0cff Make the example script to read screen geometry work on POSIX sh 2025-11-24 09:31:52 +05:30
Kovid Goyal
43253ad7c4 Change version added for choose files
Its only becoming fully functional now
2025-11-23 12:16:47 +05:30
Kovid Goyal
37da04aad6 choose files: Add default mappings to choose a file and insert it into the terminal 2025-11-23 11:41:21 +05:30
Kovid Goyal
11dd7eeb8e Have the --start-as flag be respected when used with --single-instance
Fixes #9228
2025-11-17 17:42:26 +05:30
Kovid Goyal
e49d940621 kitten @ ls: Also output the neighbors for every window 2025-11-16 21:01:55 +05:30