Commit Graph

146 Commits

Author SHA1 Message Date
Kovid Goyal
616fcfd201 More tests 2024-02-25 09:57:35 +05:30
Kovid Goyal
b3ca5d51fb Use the new SIMD utf-8 decoder 2024-02-25 09:57:35 +05:30
Kovid Goyal
e783eccc97 fix handling of bits from high byte of 4 byte sequences 2024-02-25 09:57:35 +05:30
Kovid Goyal
fa3579656b More invalid utf-8 tests 2024-02-25 09:57:34 +05:30
Kovid Goyal
8a10fcaf5a More tests 2024-02-25 09:57:34 +05:30
Kovid Goyal
4c8b8caead Handle trailing incomplete sequences 2024-02-25 09:57:34 +05:30
Kovid Goyal
4238fedee7 More tests 2024-02-25 09:57:34 +05:30
Kovid Goyal
b0dcdf74bd More tests and micro-optimize switch to ASCII fast path 2024-02-25 09:57:34 +05:30
Kovid Goyal
b28fbf6817 fix zero-ing of last n bytes 2024-02-25 09:57:34 +05:30
Kovid Goyal
daa169b8ed More work on utf8 SIMD decode 2024-02-25 09:57:34 +05:30
Kovid Goyal
b146e9c457 Add basic parser tests for pending mode activation/de-activation 2024-02-25 09:57:32 +05:30
Kovid Goyal
1f835b27c4 start work on implementing pending mode as paused rendering 2024-02-25 09:57:32 +05:30
Kovid Goyal
e52bcb5b93 more workon simd utf-8 decode 2024-02-25 09:57:31 +05:30
Kovid Goyal
74391d7c50 More work on SIMD utf-8 decode 2024-02-25 09:57:31 +05:30
Kovid Goyal
0ed1c6f840 Simplify utf8 parser func
Also show a replacement char for incomplete utf-8 sequences interrupted by an esc char
2024-02-25 09:57:31 +05:30
Kovid Goyal
200e5bf6e3 Examine 8 bytes at once for terminator char 2024-02-25 09:57:26 +05:30
Kovid Goyal
65aca5b140 Speedup utoi by loading numbers in 8 byte chunks 2024-02-25 09:57:24 +05:30
Kovid Goyal
e7c466797c threading test for full buffer 2024-02-25 09:57:24 +05:30
Kovid Goyal
c66c0b8edc threading tests for pending 2024-02-25 09:57:24 +05:30
Kovid Goyal
50935b6c93 Cleanup kitty dcs parsing 2024-02-25 09:57:24 +05:30
Kovid Goyal
8bff6f1995 More threading tests 2024-02-25 09:57:24 +05:30
Kovid Goyal
9f337e93fc Add some threading tests 2024-02-25 09:57:24 +05:30
Kovid Goyal
72635c55c5 Convenience methods to test parser threading 2024-02-25 09:57:24 +05:30
Kovid Goyal
93784903b2 Remove FLUSH_DRAW as it is not needed 2024-02-25 09:57:24 +05:30
Kovid Goyal
afcffc03b1 Separate test of write and read so we can test threading 2024-02-25 09:57:24 +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
c81ac668da Use a single code path for tests and live VT parsing 2024-02-25 09:57:23 +05:30
Kovid Goyal
f42b49e597 Avoid a double parse for pending mode 2024-02-25 09:57:23 +05:30
Kovid Goyal
969bd05fc5 Represent malformed UTF-8 with the replacement character 2024-02-25 09:57:23 +05:30
Kovid Goyal
8a83014f51 Dont construct memoryview when not needed in non dump code path 2024-02-25 09:57:23 +05:30
Kovid Goyal
76158f39ba Pass the window id to the dump calback 2024-02-25 09:57:23 +05:30
Kovid Goyal
065866895c Get pending mode working and add a few more tests 2024-02-25 09:57:23 +05:30
Kovid Goyal
52025ff030 misc parser and test fixes 2024-02-25 09:57:22 +05:30
Kovid Goyal
e4bb00d942 Implement UTF-8 decoding for screen_draw() 2024-02-25 09:57:22 +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
52d5a4679f Graphics protocol: Support for positioning images relative to other images
Fixes #6617
2023-10-27 15:27:30 +05:30
Kovid Goyal
25ed0c9c51 ... 2023-07-30 19:49:38 +05:30
Kovid Goyal
b83e4d88f4 Implement fast padding-less base64 encode/decode for python 2023-07-30 19:49:38 +05:30
Sergei Grechanik
d63eeada73 Image placement using Unicode placeholders
This commit introduces the Unicode placeholder image placement method.
In particular:
- Virtual placements can be created by passing `U=1` in a put command.
- Images with virtual placements can be displayed using the placeholder
  character `U+10EEEE` with diacritics indicating rows and columns.
- The image ID is indicated by the foreground color of the placeholder.
  Additionally, the most significant byte of the ID can be specified via
  the third diacritic.
- Underline color can be optionally used to specify the placement ID.
- A bug was fixed, which caused incomplete image removal when it was
  overwritten by another image with the same ID.
2023-02-21 18:23:16 -08:00
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
da5e37620e Also test changing of title when running command 2022-02-21 21:17:52 +05:30
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
8f214c51c0 Get rid of kitty's special OSC 52 protocol
A better solution from an ecosystem perspective is to just work with the
original protocol. I have modified kitty's escape parser to special case
OSC 52 handling without changing its max escape code size.

Basically, it works by splitting up OSC 52 escape codes longer than the
max size into a series of partial OSC 52 escape codes. These get
dispatched to the UI layer where it accumulates them upto the 8MB limit
and then sends to clipboard when the partial sequence ends.

See https://github.com/ranger/ranger/issues/1861
2021-07-23 22:18:02 +05:30
Kovid Goyal
1ef895e246 When dumping commands dump stop_pending_mode at the correct place 2021-07-03 12:07:46 +05:30
Kovid Goyal
38ae370202 Fix #3789 2021-07-03 10:12:44 +05:30
Kovid Goyal
026d200add Fix a bug in the implementation of the synchronized updates escape code that could cause incorrect parsing if either the pending buffer capacity or the pending timeout were exceeded
Fixes #3779
2021-07-01 15:32:53 +05:30
Kovid Goyal
e6a17f78b6 Use the main VT parser in pending mode as well
Should get much closer semantics in the two cases and its nice not to
have an extra mini VT parser for pending mode. There is a performance
hit in pending mode, since now the pending mode bytes are round tripped
via utf-8 decoding/encoding, but its worth it for the code
simplification.
2021-06-30 10:52:22 +05:30
Kovid Goyal
5768c54c5b Add support for pending mode via SM/RM 2026
Because, why the hell not, it's not like I have an actual life.
More seriously, terminal-wg (aka Bikeshedder's Anonymous) is
pushing for it so it's likely at least one poor application writer
will fall for their propaganda.
2021-06-29 12:24:34 +05:30
Kovid Goyal
4d0d0b205d Improve parser error messages a bit 2021-05-17 21:29:54 +05:30
Kovid Goyal
b32c346eed A new protocol extension to unscroll the screen
See https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/30
2021-04-23 15:44:38 +05:30