Commit Graph

1337 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
551acca0e4 Implement maximize layout action for splits layout
Fixes #9629
Fixes #9630
2026-03-09 15:27:54 +05:30
copilot-swe-agent[bot]
5638d20921 Make showing of unmapped actions a runtime cached setting
Fixes #9591
2026-03-03 15:24:26 +05:30
copilot-swe-agent[bot]
f13c8cd44d Allow optionally showing unmapped actions in the command palette
Also highlight letters matching the search query.
Fixes #9589
2026-03-03 14:29:10 +05:30
Kovid Goyal
813f8ba7cf Merge branch 'show_keys' of https://github.com/dmgerman/kitty 2026-03-03 09:47:41 +05:30
Kovid Goyal
ced3a98aa8 Fix failing test
num_scaled_cells calculation was incorrect. Also optimize copying from
scratch when width is unchanged.
2026-02-24 09:53:06 +05:30
Daniel M German
6fa122af11 Fix action triggering by using kitten output instead of remote control
The RC approach sent actions targeting the overlay window itself rather
than the underlying window. Switch to the standard kitten output pattern:
the Go kitten outputs the selected action definition via
KittenOutputSerializer, and handle_result in Python calls boss.combine()
with the correct target window after the overlay closes.
2026-02-22 21:12:36 -08:00
Daniel M German
33b5b0a339 Add command_palette command to display bound keys
Add a Go-based command_palette kitten that provides a searchable,
interactive overlay for browsing and triggering keyboard shortcuts
and actions.

- New Go kitten at kittens/command_palette/ with FZF fuzzy search,
  grouped/flat views, and remote control action triggering
- Python collect_keys_data() does data collection, passed via stdin
- Navigation: arrows, ctrl+j/k (vim), ctrl+n/p (emacs), page up/down
- Enter triggers the selected action via RC command
- Help text displayed in footer for selected binding
- Added Go tests (main_test.go) and Python tests (command_palette.py)
2026-02-22 20:46:47 -08:00
Kovid Goyal
8df80afa79 URL detection: Allow trailing asterisks in URLs
Fixes #9543
2026-02-23 07:54:47 +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
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
a214097b55 Close hyperlinks more eagerly when serializing to ANSI
Fixes #9405
2026-01-23 10:11:26 +05:30
Kovid Goyal
b52a9031ca Fix selections test failing due to pixel scroll
Note this only fixes the test, there is still the actual issue of
the selection not being rendered for the top most line if that line is
partially scrolled offscreen
2026-01-08 12:40:40 +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
e14e34948e More cleanups for color parsing
Using rounding when converting float to uint8 for more accuracy.
Fix rgb:3 and rgbi: parsing in Go code. Various other minor cleanups.
2025-12-31 09:35:09 +05:30
Kovid Goyal
7c13c04c84 Move color parsing code to C for performance 2025-12-30 21:43:57 +05:30
Kovid Goyal
62d5fcc074 Merge branch 'wide-gamut-colors' of https://github.com/jokull/kitty 2025-12-30 13:19:44 +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
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
0037e3a97d Add parse test for CSI 14;2 t 2025-11-24 11:23:21 +05:30
Kovid Goyal
478294a335 Fix typo that caused OSC 3008 to set title rather than just be ignored
Fixes #9226
2025-11-17 12:23:10 +05:30
Kovid Goyal
e6d7e91000 Avoid using lseek() to track disk cache file write offset
It's slow and not thread safe.
We use pwrite() so it's not reliable anyway.
2025-11-17 11:16:30 +05:30
Kovid Goyal
e49d940621 kitten @ ls: Also output the neighbors for every window 2025-11-16 21:01:55 +05:30
Kovid Goyal
456fa8691a Fix #9211 2025-11-11 09:35:55 +05:30
Wukuyon
65890de60d Fix UTF-8 overlong and special range checks in simd-string-impl.h
Modified `start_classification` in `utf8_decode_to_esc` in `simd-string-impl.h`, which now:

Rejects `0xC0`, `0xC1` and `0xF5..0xFF` lead bytes in UTF-8 subsequences.

Enforces special ranges for the second subsequence bytes after `0xE0`, `0xED`, `0xF0` and `0xF4` bytes to prevent overlong sequences, surrogates, and code points above U+10FFFF.

Accumulates UTF-8 validation errors in a single vector to avoid many conditional branches.

Worsens unicode benchmark performance by about 4%.
2025-10-23 22:37:33 -06:00
Wukuyon
295951348c Add boundary case tests for test_utf8_simd_decode
These tests were generated from Node.js and match the WHATWG Encoding Specification's behavior (substitution of maximal subparts).
2025-10-23 21:43:20 -06:00
Wukuyon
77a3fc8dd2 Swap expected/actual variables in t function in test_utf8_simd_decode
For more useful debugging.
The expected value is what the scalar decoder returns.
The actual value is what the "which" SIMD decoder returns.
2025-10-23 21:43:20 -06:00
Kovid Goyal
26ea343f95 Fix failing tests 2025-10-22 13:21:53 +05:30
Kovid Goyal
1e1a1851d0 Add support for Unicode 17
This is preliminary, all tests pass, but needs more careful review.
2025-10-18 09:59:53 +05:30
Kovid Goyal
6586780371 Merge branch 'draw-borders-when-focused' of https://github.com/jackielii/kitty 2025-10-15 08:56:02 +05:30
Kovid Goyal
dd7caaa91b ... 2025-10-15 08:09:29 +05:30
Kovid Goyal
ee9a5386b9 When doing a reset also reset termios to its initial state 2025-10-15 07:56:45 +05:30
Jackie Li
6a2ee9253b set_options() in layout tests 2025-10-14 19:43:07 +01:00
Kovid Goyal
16d411943a Add integration test for go atexit implementation 2025-09-30 12:37:25 +05:30
Kovid Goyal
2f991691f9 Fix test failure with fish >= 4.1
fish now requires a response to a DA1 query
2025-09-29 14:01:57 +05:30
Kovid Goyal
3d0ec1c684 Only skip invalid UTF8 tests when actually using SIMD 2025-09-15 08:59:03 +05:30
Kovid Goyal
5d9a28f7a1 Move utf8_parsing tests to simd_decode
More robust as the tests are run against all three SIMD modes, no SIMD,
128bit and 256 bit
2025-09-15 08:53:03 +05:30
Kovid Goyal
42aa5957a5 Comment out all the failing invalid UTF-8 tests 2025-09-15 08:43:58 +05:30
Wukuyon
542c425488 test_utf8_parsing: Add more tests for UTF-8 maximal subpart replacement 2025-09-14 16:50:38 -06:00
Wukuyon
346384351e test_utf8_parsing: Add comments describing each assertion 2025-09-14 16:33:53 -06:00
Alexis (Poliorcetics) Bourget
4cccf929eb fix: when parsing python_strings options, don't fail if ' is last
Previously, if the last character was `'` parsing would fail: from `abc'`
it would produce the literal `'''abc''''`, which has one too many
unescaped single quote at the end.

This also fixes the issue for solo `'''`, where before it would produce
`''''\\'''''`, again with one too many single quote at the end.

I added tests for both cases.
2025-09-06 20:33:15 +02:00
Kovid Goyal
44b5d8f656 Dont use negative numbers in multi cursor protocol
There are apparently many parsers out there that cant handle them.
2025-08-26 21:43:37 +05:30
Kovid Goyal
da641982e2 Start work on specifying a color for extra cursors 2025-08-26 18:56:31 +05:30
Kovid Goyal
518e06cfa4 Also report -2 in query response 2025-08-25 15:30:36 +05:30
Kovid Goyal
24049a1a5a Implement round tripping of SGR blink (5/25) 2025-08-25 12:34:38 +05:30
Kovid Goyal
bacd13d3a7 extra cursors: Add some tests for invalid input handling 2025-08-24 20:25:38 +05:30
Kovid Goyal
8f5dc42a61 Parser for multi cursor escape code 2025-08-24 20:14:14 +05:30
Kovid Goyal
e6c1597834 Start work on multiple hardware cursors 2025-08-24 20:14:14 +05:30
Kovid Goyal
337cbf1435 Add an env var that can be used to eval an expression at startup of shell
This will come in handy to implement serialization as session
with running of current foreground command.
2025-08-16 11:58:30 +05:30
Kovid Goyal
a0b58ef205 Dont allow CUB to move cursor onto previous line
Reserve this behavior for actual backspace. Fixes #8900
2025-08-14 21:49:36 +05:30
Kovid Goyal
d52f2e7981 Rewrite rendering pipeline
This was needed to fix various corner cases when doing blending of colors
in linear space. The new architecture has the same performance as the
old in the common case of opaque rendering with no UI layers or images.

In the case of only positive z-index images there is a performance
decrease as the OS Window is now rendered to a offscreen texture and
then blitted to screen. However, in the future when we move to Vulkan or
I can figure out how to get Wayland to accept buffers with colors in
linear space, this performance penalty can be removed. The performance
penalty was not significant on my system but this is highly GPU
dependent. Modern GPUs are supposedly optimised for rendering to
offscreen buffers, so we will see. The awrit project might be a good
test case.

Now either we have 1-shot rendering for the case of opaque with only ext
or all the various pieces are rendered in successive draw calls into an
offscreen buffer that is blitted to the output buffer after all drawing
is done.

Fixes #8869
2025-08-11 00:47:02 +05:30