Commit graph

153 commits

Author SHA1 Message Date
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
bca017fa4c
Fix #8741 2025-06-20 20:11:23 +05:30
Kovid Goyal
15781435ae
Cleanup reading of argv from files 2025-04-28 09:54:57 +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
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
66856e7b52
Use a multi-stage lookup table for grapheme segmentation 2025-03-31 21:51:28 +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
0d866b1f13
Add tests for grapheme segmentation
Test data provided by Unicode organisation
2025-03-13 13:48:35 +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
cf2fffaf95
Fix continuation char marking when rewrapping historybuf 2025-02-03 10:56:49 +05:30
Kovid Goyal
b5dff921c4
Start work on multicell support 2025-02-03 10:56:43 +05:30
Kovid Goyal
0eaf44d33d
Add tests for strip_csi with multibyte 2024-11-24 09:28:21 +05:30
Kovid Goyal
5e36e0a324
Fix text_at 2024-11-04 09:10:07 +05:30
Kovid Goyal
30f4441fe5
Fix line_as_ansi 2024-11-04 09:10:07 +05:30
Kovid Goyal
913ce58fe3
Make shlex_split always return a token
Matches behavior of split() so is therefore more intuitive
2024-09-02 17:30:18 +05:30
Kovid Goyal
2b3f2258ff
More pyugrade to 3.9 2024-08-05 11:00:51 +05:30
Kovid Goyal
1c9d9e394c
Have close notifications indicate when notification is not found 2024-07-25 07:58:17 +05:30
Kovid Goyal
deff40df8a
New OSC 21 protocol for color control
Needs to be specced up
2024-07-22 10:57:13 +05:30
Kovid Goyal
0cf9a79760
A new option second_transparent_bg
Makes a second background color semi-transparent via background_opacity.
Useful for things like cursor line highlight in editors.

Fixes #7646
2024-07-21 20:22:31 +05:30
Kovid Goyal
098ed41716
Add support for ANSI-C quoted strings to shlex 2024-05-09 11:46:23 +05:30
Kovid Goyal
6205fb32fd
Refactor VT parser for more speed
No longer copy bytes into a separate buffer, instead parse them in place
in the read buffer
2024-02-25 09:57:23 +05:30
Kovid Goyal
23bb2e1b67
Fast function to replace c0 codes 2024-02-25 09:57:23 +05:30
Kovid Goyal
8cc2cad4d9
Use list of legal chars in URL from the WHATWG standard
Notably this excludes some ASCII chars: <>{}[]`|
See https://url.spec.whatwg.org/#url-code-points

Fixes #7095
2024-02-05 13:27:22 +05:30
Kovid Goyal
b0ba4b4a42
Fast and robust implementation of shlex.split
Also returns position of words in src string which we will need for
keymap parsing.
2023-12-02 14:57:02 +05:30
Kovid Goyal
77292a16d6
Make shebangs consistent
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.

Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
defa2e29ac
Always ask for confirmation when pasting text with control codes in it 2023-10-20 13:02:28 +05:30
Kovid Goyal
56963c693e
When pasting in bracketed paste mode and the cursor is at a shell prompt, strip out C0 control codes
Some shells incorrectly interpret these allowing escape from bracketed paste mode. Thanks to David Leadbetter for discovering.
2023-10-20 12:17:13 +05:30
Kovid Goyal
750018e5fe
... 2023-05-25 12:25:46 +05:30
Kovid Goyal
cb936c1b5b
Use /dev/null rather than /dev/tty for the test 2023-05-25 12:24:59 +05:30
Kovid Goyal
624007c7aa
Refuse to read image files in /proc /sys and /dev
Also, open the image file with O_NONBLOCK to ensure we dont hang opening
a FIFO
2023-05-25 12:17:03 +05:30
Kovid Goyal
7fe5d7b58f
Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
306f9e5735
Prettify URLs before displaying them to the user 2022-12-29 17:04:02 +05:30
Kovid Goyal
68cf9f7514
Switch to tracking linewrap on the last cell in a line
This allows us to have newline not affect the wrap status of a line.

Now a lines wrapping status is changed only when the last cell
in the line is changed. This actually matches the behavior of many other
terminal emulators so is probably a good thing from a ecosystem
compatibility perspective.

The fish shell expects this weird behavior of newline not changing
wrapping status, for unknown reasons, which is the actual motivation for
doing all this work.

Fixes #5766
2022-12-26 20:26:21 +05:30
Kovid Goyal
c6360537e5
Try to fix tests failing on Python 3.11 2022-12-16 10:05:05 +05:30
Kovid Goyal
f9a22d0bc7
Port ANSI escape code parser to Go 2022-11-25 21:03:09 +05:30
Kovid Goyal
cfc6bd4da5
Native code implementation for expanding ANSI escape codes 2022-11-25 17:33:41 +05:30
Kovid Goyal
8796168469
Port code to truncate strings to visual width to Go 2022-11-14 15:41:58 +05:30
Kovid Goyal
0d64246209
fix vim autoindent 2022-09-24 08:31:14 +05:30
Kovid Goyal
a0495219ab
... 2022-09-24 08:30:40 +05:30
Kovid Goyal
26b8ab9adf
Use a regex for bracketed paste sanitization 2022-09-23 22:18:03 +05:30
Kovid Goyal
f05783e64d
Sanitize notifications ids as they are retransmitted over the TTY 2022-09-05 10:41:19 +05:30
Kovid Goyal
992e90b0a3
Fix a regression in 0.26.0 that broke mapping of native keys who key codes did not fit in 21 bits
Fixes #5452
2022-08-31 22:19:51 +05:30
Kovid Goyal
c982f24faf
Add some tests for hashing and __eq__ 2022-08-12 12:02:22 +05:30