Commit graph

1484 commits

Author SHA1 Message Date
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
Kovid Goyal
b0439d4183
Function to erase the last command and its output 2025-08-07 08:45:45 +05:30
Kovid Goyal
f61b15b284
Fix incorrect handling of VS16 when it causes char to wrap to next line and is part of a draw command with more characters following it
Needed to initialize full text loop state rather than just segmentation
state on wrap. Fixes #8848
2025-07-26 09:25:01 +05:30
Kovid Goyal
45b2678db1
Allow backspace to wrap cursor to previous line
Fixes #8841
2025-07-23 08:56:54 +05:30
Kovid Goyal
12c1b0cbdf
remove leftover debug prints 2025-07-20 21:45:36 +05:30
Kovid Goyal
2e92d610d5
Implement metadata based previews in choose-files 2025-07-20 09:31:17 +05:30
Kovid Goyal
fd20fd23bb
Use clean HOME and CONF and CACHE dirs when running Go tests 2025-07-09 13:29:33 +05:30
Kovid Goyal
d7c4d42f41
Fix #8794 2025-07-09 12:49:12 +05:30
Kovid Goyal
c681a999d5
Fix hyperlink id not being applied to wide cells
Fixes #8796
2025-07-09 12:14:09 +05:30
Kovid Goyal
eabddc2870
Report support for OSC52 write to clipboard in DA1
There are apparently some applications that want to only turn on OSC52
if they can be sure the terminal supports it.
https://github.com/contour-terminal/vt-extensions/blob/master/clipboard-extension.md

Seems harmless enough, though IMO the correct query mechanism for
runtime controllable settings is XTGETTCAP, but, let's be a
good citizen and co-operate. The overhead is not too large and I
have more important windmills to tilt at.

Fixes #8788
2025-07-07 08:45:58 +05:30
Kovid Goyal
75f10d140f
Fix off-by-one in code to nuke incomplete multicell chars in line
Fixes #8758
2025-06-27 11:35:18 +05:30
Jacob Komissar
9549618bc9 Escape user input in zsh integration's _ksi_preexec
Also fix a bug in one of the test assertions to make the test work.
2025-06-23 18:44:52 -04:00
Kovid Goyal
bca017fa4c
Fix #8741 2025-06-20 20:11:23 +05:30
Kovid Goyal
8e55cf7552
Fix #8731 2025-06-14 20:19:21 +05:30
Kovid Goyal
61fd8c4003
Fix #8682 2025-05-27 12:10:14 +05:30
Kovid Goyal
c861259e3b
Rename go module from kitty -> github.com/kovidgoyal/kitty
Makes the code more easily re-useable in other projects
2025-05-16 08:43:39 +05:30
Kovid Goyal
68b4c3dd6d
Fix ambiguous width and private use characters not being rendered when used with variable width text-sizing protocol escape codes 2025-05-12 05:21:51 +05:30
Kovid Goyal
1237f7667c
... 2025-05-03 10:47:03 +05:30
Kovid Goyal
7dc673e485
Add XFCE to the X11 compatibility matrix 2025-05-03 10:39:41 +05:30
Kovid Goyal
07cda6ac45
Add GNOME to the X11 compatibility matrix 2025-05-03 08:57:55 +05:30
Kovid Goyal
8d213bba04
Make test more robust against env 2025-04-30 05:50:05 +05:30
Kovid Goyal
b9326f5c94
Add some formatting to CLIParser error messages 2025-04-29 07:26:48 +05:30
Kovid Goyal
909b8747d3
Add launcher test for list style options 2025-04-28 13:55:36 +05:30
Kovid Goyal
14792aa60e
Allow partial option matches in C CLI parser as well
Matches behavior of Go parser and is nice to have
2025-04-28 12:43:09 +05:30
Kovid Goyal
15781435ae
Cleanup reading of argv from files 2025-04-28 09:54:57 +05:30
Kovid Goyal
5c9c8aa424
Add unit testing for launcher code 2025-04-28 09:25:25 +05:30
Kovid Goyal
b0ae88ada9
Wire up the codegen C cli parser 2025-04-28 09:20:11 +05:30
Kovid Goyal
1413d8fb85
Fix handling of --help and --version 2025-04-28 09:20:11 +05:30
Kovid Goyal
27c5b6aac5
Generate option parser in C for kitty CLI 2025-04-28 09:20:10 +05:30
Kovid Goyal
62699f6799
Get basic C cli parsing working 2025-04-28 09:20:10 +05:30
Kovid Goyal
3f00dc1c9e
Work on improving CLI parsing
Can now set bool values explicitly with =
Handle multi short flag args like -abc
Add unit tests for CLI parsing
Generate go code to serialize CLI options as a cmdline

TODO: Implement setting of bool vals in C and Go parsing code
TODO: Help/rst output should somehow indicate this feature
2025-04-26 09:01:54 +05:30
Kovid Goyal
2093fb1310
Fix handling of empty quoted string in shlex 2025-04-26 08:55:32 +05:30
Kovid Goyal
7bd7709685
Move parsing of macos-launch-services-cmdline into native code
Avoids expensive re-exec and simplifies various things. Much faster
for single instance usage.
2025-04-25 14:39:36 +05:30
Kovid Goyal
639ad3e8a6
Make shlex code re-useable in launcher 2025-04-25 09:35:42 +05:30
Kovid Goyal
76ac66fc8c
Implement various filesystem utility functions in C so they can be used in the launcher 2025-04-24 20:37:51 +05:30
Kovid Goyal
f0f5e53dbe
Fix failing test 2025-04-23 09:07:13 +05:30
Kovid Goyal
82e2fe82d6
Add a couple more gseg tests 2025-04-11 13:34:16 +05:30
Kovid Goyal
3f919cbc56
Specify the algorithm for splitting text into cells 2025-04-11 09:34:21 +05:30
Kovid Goyal
b32a5492c5
Add test for wrap with combining char 2025-04-11 09:34:21 +05:30
Kovid Goyal
c01a941fe7
Get the unicode grapheme seg tests passing on screen, with minimal modification
We ignore tests including ACII control codes and we modify the results
when there are grapheme breaks before zero width characters.
2025-04-11 09:34:21 +05:30
Kovid Goyal
203e9f6c58
Port wcswidth to use grapheme segmentation 2025-04-11 09:34:21 +05:30
Kovid Goyal
2cad589f1c
Add tests for combining at screen edge 2025-04-11 09:34:21 +05:30
Kovid Goyal
4c2bd8ffb1
Implement zero width roundtripped chars in multicell segmentation as well 2025-04-11 09:34:21 +05:30
Kovid Goyal
f5e8de2e4f
Implement grapheme segmentation in the terminal layer 2025-04-11 09:34:21 +05:30
Kovid Goyal
d1938cb060
Fix failing test 2025-04-08 13:07:59 +05:30
Kovid Goyal
7e3e567916
Dont use subTest as it doesnt work with retry_on_failure 2025-04-07 05:22:15 +05:30
Kovid Goyal
f578e8d25b
Cleanup various test related things 2025-04-07 04:41:19 +05:30
Your Name
33167f2057 Change mouse_hide_wait to struct, and change mouse_show_* options to optional parameters for struct. mouse_show_* renamed to mouse_unhide_* 2025-04-04 11:22:56 +00:00
Your Name
464446e388 Prevent mouse cursor from showing on short, unintentional flicks 2025-04-04 04:33:47 +00:00
Kovid Goyal
66856e7b52
Use a multi-stage lookup table for grapheme segmentation 2025-03-31 21:51:28 +05:30
Arvin Verain
6d75f7cff4
test: Add method to easily set last_visited attributes 2025-03-28 22:38:19 +08:00
Arvin Verain
07f30122e6
test: Add more tests for cmd paging edge cases 2025-03-28 22:38:18 +08:00
Kovid Goyal
9e1601a9b5
Nicer way to include grapheme test data in Go tests 2025-03-27 03:20:27 +05:30
Kovid Goyal
f058c597ae
Dont rely on hard links 2025-03-26 21:59:24 +05:30
Kovid Goyal
305c1a25c5
More robust fetching of grapheme break test data in Go test 2025-03-26 21:56:52 +05:30
Kovid Goyal
2aa2607adc
... 2025-03-25 17:13:54 +05:30
Kovid Goyal
3e50588525
Add a test for PUA recog 2025-03-25 16:52:01 +05:30
Kovid Goyal
f57f3d9909
Fix #8464 2025-03-21 19:55:45 +05:30
Kovid Goyal
b853f3a986
Show timeout duration in error 2025-03-20 08:50:53 +05:30
Kovid Goyal
0d866b1f13
Add tests for grapheme segmentation
Test data provided by Unicode organisation
2025-03-13 13:48:35 +05:30
Kovid Goyal
fd8172c04d
Fix a regression in the previous release that caused empty lines to be skipped when copying text from a selection
Fixes #8435
2025-03-12 16:47:13 +05:30
Kovid Goyal
8cbdd003e2
Make deleting test dir suring shell integration tests robust against fish 4 background daemon generating completions 2025-03-08 10:42:18 +05:30
Kovid Goyal
ac9ed921d7
Temp fix for failing fish integration test
fish >= 3.8 wants to send shell integration OSC 133 itself. However it
does not send the cmdline_url parameter, causing our integration tests
to fail. Temporarily fix by commenting out the tests for it.

Fixes #8385
2025-03-02 15:41:47 +05:30
Kovid Goyal
2907999131
Use the same algorithm for rendering box cells and font based cells
Should make things easier to change in tandem in future.
2025-02-19 17:05:43 +05:30
Kovid Goyal
15f711d6b5
Start work on horizontal align for multicells 2025-02-19 07:50:40 +05:30
Kovid Goyal
bedc2ea1b9
Reduce num of bits used for x/y multicell 2025-02-19 05:53:07 +05:30
Kovid Goyal
c4ef0a0eef
Add another test 2025-02-19 05:26:03 +05:30
Arvin Verain
a5cafdd8e9
test: Add more tests for scroll_to_prompt, fco, and lvco 2025-02-19 00:30:04 +08:00
Kovid Goyal
8f44e16b89
Fix scroll_to_prompt after resize that causes prompt line wrapping not accurate
See #8334
2025-02-18 19:40:23 +05:30
Kovid Goyal
eb5a9bc6a3
... 2025-02-18 19:02:32 +05:30
Kovid Goyal
6f57537f30
Fix failing test 2025-02-18 18:44:57 +05:30
Kovid Goyal
c520b0b1b9
Add test for PR #8322 2025-02-18 10:08:41 +05:30
Kovid Goyal
2caa3fc069
... 2025-02-17 20:18:14 +05:30
Kovid Goyal
a7f76ee8f7
Fix #8339 2025-02-17 19:56:39 +05:30
Kovid Goyal
b4b2b44c92
Multicell selections: Clamp to line
When the end point of the selection is within a multicell character of
the same size and vertical position as the start point, clamp the
selection line to the start line to avoid un-intuitive multiline
selections.

Fixes #8310
2025-02-15 13:11:46 +05:30
Kovid Goyal
dc5c9b5bf4
Another test 2025-02-15 11:38:49 +05:30
Kovid Goyal
0e820f5d9c
ANSI output: Preserve use of natural_width
Keeps semantics of the text the same when roundtripping rather than
visual appearance.
2025-02-15 11:03:20 +05:30
Kovid Goyal
888b8a3bfb
Use same algorithm for multicell selection expansion and text extraction 2025-02-15 10:43:32 +05:30
Kovid Goyal
e7a40300d1
Fix crash when rendering a cell with a large number of combining chars
Caused by kitty now supporting larger number of combining chars per
cell. Fixes #8318
2025-02-12 08:23:46 +05:30
Kovid Goyal
077116e027
Fix a typo causing corruption of multiline chars split between history buffer and line buffer on resize 2025-02-11 11:55:15 +05:30
Kovid Goyal
5adc81e146
Skip colrv1 rendering on macOS 2025-02-03 11:06:41 +05:30
Kovid Goyal
d068a0a6de
Add basic colrv1 rendering test 2025-02-03 11:06:41 +05:30
Kovid Goyal
8bf8f5dc46
Finish up testing for multicell URL detection 2025-02-03 10:56:50 +05:30
Kovid Goyal
64e3b641ce
Get basic multicell URL detection working 2025-02-03 10:56:50 +05:30
Kovid Goyal
6a19918687
More work on multicell URL detection 2025-02-03 10:56:50 +05:30
Kovid Goyal
f599144913
Fix multicell marking of hyperlinks 2025-02-03 10:56:50 +05:30
Kovid Goyal
2423c2166e
More tests for multicell selections 2025-02-03 10:56:50 +05:30
Kovid Goyal
da1626090a
Update codebase to Python 3.10 using pyupgrade 2025-02-03 10:56:50 +05:30
Kovid Goyal
922d08516b
... 2025-02-03 10:56:50 +05:30
Kovid Goyal
ac1aaab077
More work of selections as text 2025-02-03 10:56:50 +05:30
Kovid Goyal
ac32f91a2e
Implement rendering of selections that intersect multicell cells 2025-02-03 10:56:49 +05:30
Kovid Goyal
dc5037ff37
Add tests for multicell char split between history and line buffers 2025-02-03 10:56:49 +05:30
Kovid Goyal
561686c9d4
Refactor rewrap code, again
Now we do the rewrap of history and line buffers together. This is
faster and deals with multiline chars split between the two buffers
correctly. Also, considerably simpler code.
2025-02-03 10:56:49 +05:30
Kovid Goyal
97449dfddb
Cursor tracking tests
Also fix extra x movement for tracked cursors
2025-02-03 10:56:49 +05:30
Kovid Goyal
c4a32862d1
Implement restitch during rewrap
Faster, less code and gets us multicell handling during restitching for
free.
2025-02-03 10:56:49 +05:30
Kovid Goyal
b3c39f4921
Finish up the redraw multicell tests 2025-02-03 10:56:49 +05:30
Kovid Goyal
001cc8009e
More multicell rewrap tests 2025-02-03 10:56:49 +05:30
Kovid Goyal
decafb0d3f
More multicell wrap tests 2025-02-03 10:56:49 +05:30
Kovid Goyal
cf5f6e97e8
Add some basic tests for multicell rewrap 2025-02-03 10:56:49 +05:30
Kovid Goyal
cf2fffaf95
Fix continuation char marking when rewrapping historybuf 2025-02-03 10:56:49 +05:30
Kovid Goyal
5b0e1b5b5c
Fix wrap marker when continuing to a new line with a multicell command 2025-02-03 10:56:48 +05:30
Kovid Goyal
95fbc6e9ba
Forgot a couple of octants 2025-02-03 10:56:48 +05:30
Kovid Goyal
39dc31e021
Render the octant characters using box drawing 2025-02-03 10:56:48 +05:30
Kovid Goyal
c67475271f
Remove box drawing python code 2025-02-03 10:56:48 +05:30
Kovid Goyal
bbcb7dc24c
Fix cursor rendering when on first cell of multicell 2025-02-03 10:56:47 +05:30
Kovid Goyal
f67c58034c
Add tests for ch_and_idx 2025-02-03 10:56:47 +05:30
Kovid Goyal
1707e603f3
Implement underline exclusion 2025-02-03 10:56:46 +05:30
Kovid Goyal
27c862970b
Simplify sprite management code
Now if decorations are needed they are created *before* the index for
the sprite is assigned.
2025-02-03 10:56:46 +05:30
Kovid Goyal
b2a4db2028
Revert metadata row for sprites
Store in a separate VAO instead more performant as it uses less VRAM and
allows shader lookup co-ords to be passed to fragment shaders without
calculation in the fragment shader.
2025-02-03 10:56:45 +05:30
Kovid Goyal
9e9ab3e6f9
pass decorations location as sprite metadata 2025-02-03 10:56:45 +05:30
Kovid Goyal
5d195bf50b
Give sprites a metadata row accessible in the shaders
Will allow sprites to point to where their decorations should be read
from, for instance. Needed for scaled text and also if we want to
implement decoration avoidance.
2025-02-03 10:56:45 +05:30
Kovid Goyal
0fb49f4139
Switch to using an index for sprite tracking
Frees up two bytes in GPUCell. Doesn't require a minimum texture row
size. Makes a bunch of code faster. Index uses 31 bits which gives us
2,147,483,647 aka ~ 2 billion sprites.
2025-02-03 10:56:45 +05:30
Kovid Goyal
87dea95a0e
Fix rendering of scaled emoji 2025-02-03 10:56:45 +05:30
Kovid Goyal
27bcd96071
Tests for combining char on multicell 2025-02-03 10:56:45 +05:30
Kovid Goyal
06c428ba7b
Fix drawing multiple chars where the second or later char is on a multicell 2025-02-03 10:56:45 +05:30
Kovid Goyal
4a0086b241
Fix vertical_align serialization 2025-02-03 10:56:45 +05:30
Kovid Goyal
5c2c88858b
Implement reporting of multicell commands 2025-02-03 10:56:45 +05:30
Kovid Goyal
1aec299ad8
... 2025-02-03 10:56:45 +05:30
Kovid Goyal
42e93d8caa
More work on scaled font rendering 2025-02-03 10:56:44 +05:30
Kovid Goyal
3dca2687d8
Make font rendering tests use a text font rather than system font 2025-02-03 10:56:44 +05:30
Kovid Goyal
850dcec4d7
Allow multiple box rendering chars per cell 2025-02-03 10:56:44 +05:30
Kovid Goyal
073d5c7340
Add test for quarter blocks 2025-02-03 10:56:44 +05:30
Kovid Goyal
8030cbd361
Allow more subscales 2025-02-03 10:56:44 +05:30
Kovid Goyal
b1c80d212f
Allow non-width multicell code to fill multiple cells using native width algo 2025-02-03 10:56:44 +05:30
Kovid Goyal
844d538e40
When drawing text, skip past multiline chars 2025-02-03 10:56:44 +05:30
Kovid Goyal
79a062466c
Fix render_box_cell test with odd block height 2025-02-03 10:56:44 +05:30
Kovid Goyal
35946f9386
Improve performance of processing wide chars
Store multi cell data in the CPUCell rather than in TextCache.
This sends the CPUCell size back to 12 but in benchmarks ASCII
performance is untouched and Unicode performace goes back to what it was
before multicell
2025-02-03 10:56:44 +05:30
Kovid Goyal
383e1f8f57
Work on scaled rendering for box drawing chars 2025-02-03 10:56:43 +05:30
Kovid Goyal
394404a1ab
Add multicell tests for various edit operations 2025-02-03 10:56:43 +05:30
Kovid Goyal
e10df382f8
Tests for erasing characters 2025-02-03 10:56:43 +05:30
Kovid Goyal
8f0d291500
Delete chars with multicell tests 2025-02-03 10:56:43 +05:30
Kovid Goyal
23bb053fb4
Insert chars with multicell tests 2025-02-03 10:56:43 +05:30
Kovid Goyal
1ed4a349be
Clearance of multicell tests 2025-02-03 10:56:43 +05:30
Kovid Goyal
5e861ea5ac
Start work on testing multicell commands 2025-02-03 10:56:43 +05:30
Kovid Goyal
b5dff921c4
Start work on multicell support 2025-02-03 10:56:43 +05:30
Kovid Goyal
4f0f9b9aff
Fix #8262 2025-01-27 21:13:45 +05:30
Kovid Goyal
d7ce3eb66e
Keyboard events: Fix turning on only the "Report all keys as escape codes" enhancement not reporting modifier+enter/tab/backspace using escape codes 2025-01-12 19:11:19 +05:30
Kovid Goyal
1eeea70c7a
Allow dynamically generating configuration by running an arbitrary program using the new geninclude directive 2025-01-06 19:00:01 +05:30
Kovid Goyal
334adf9c1a
Ensure temp files and other resources are cleaned up even if kitty crashes or is SIGKILLed 2025-01-05 12:51:59 +05:30
Kovid Goyal
25cb73511f
Implement atexit.rmtree 2025-01-05 11:04:23 +05:30
Kovid Goyal
0d5bcff353
Tool to implement robust cleanups even on process crash 2025-01-05 10:50:50 +05:30
Kovid Goyal
dd249df5eb
Dont encode enter, tab and backspace when lock mods are set
Otherwise user cant type reset when num lock is set.
2025-01-01 06:10:47 +05:30
Kovid Goyal
909bccb807
When mapping a custom kitten allow using shell escaping for the kitten path
Fixes #8178
2024-12-31 12:13:17 +05:30
Kovid Goyal
24a195c7c7
Graphics: Fix deletion of images by id not working for images with no placements 2024-12-24 09:39:01 +05:30
Kovid Goyal
8facaf4fa0
Graphics: Fix deleted but not freed images without any references being incorrectly freed on a subsequent delete command 2024-12-18 09:25:06 +05:30
Kovid Goyal
33207a57ba
Add tests for consecutive conflicting variation selectors 2024-12-05 19:21:00 +05:30
Kovid Goyal
a4d2d933c9
Fix #8103 2024-12-05 19:19:15 +05:30
Kovid Goyal
8e388acab7
Add some cursor tracking tests 2024-11-27 20:33:56 +05:30
Kovid Goyal
778344a439
Fix enlarging window when a long line is wrapped between the first line of the scrollback buffer and the screen inserting a spurious newline
Fixes #7033
2024-11-27 20:08:27 +05:30
Kovid Goyal
cb2e1fcd04
Graphics protocol: Fix delete by number not deleting newest image with the specified number
Fixes #8071
2024-11-24 10:11:34 +05:30
Kovid Goyal
0eaf44d33d
Add tests for strip_csi with multibyte 2024-11-24 09:28:21 +05:30
Kovid Goyal
97e4625a82
... 2024-11-12 09:29:17 +05:30
Kovid Goyal
6d5a2b8ecd
Add a test that exercises the text_cache in Line code path 2024-11-12 09:16:45 +05:30
Kovid Goyal
5e36e0a324
Fix text_at 2024-11-04 09:10:07 +05:30