Commit graph

136 commits

Author SHA1 Message Date
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
Kovid Goyal
83bbcf0aa1
Graphics protocol: Add a control to allow clients to specify that the cursor should not move when displaying an image
Fixes #3411
2021-03-22 22:16:40 +05:30
Kovid Goyal
f9844ba3b0
Allow negative numbers in CSI codes 2021-01-21 07:06:43 +05:30
Kovid Goyal
e4d8aac3d5
Make CSI parsing a bit more spec compliant
Now the full list of secondary characters (intermediate bytes) is used from ECMA 48
Also the codes that accept only one parameter now report errors when
multiple parameters are passed.
2021-01-21 06:41:27 +05:30
Kovid Goyal
e96ff19a7a
Graphics protocol: Add support for having the terminal emulator assign image ids
Useful when multiple non co-operating programs want to share the screen.
Fixes #3163
2020-12-16 17:31:15 +05:30
Kovid Goyal
23420adfa6
Graphics protocol: Allow suppressing responses from the terminal to graphics commands 2020-12-03 20:42:03 +05:30
Kovid Goyal
b5e704a934
Graphics protocol: Add support for giving individual image placements their
Fixes #3133
2020-12-02 05:25:19 +05:30
Kovid Goyal
e99d93ca30
Implement parsing of OSC 8
Also start work on storing hyperlinks with cells
2020-09-10 10:47:24 +05:30
Kovid Goyal
eca53bfab0
Add a new escape code to allow terminal programs to trigger desktop notifications
Fixes #1474
2020-08-21 20:29:54 +05:30
Andrew Mayorov
9fe631ee3f
Provide support for CSI REP control code 2020-05-29 01:05:49 +03:00
Luflosi
a792c94ccf
Use python3 shebang for all python scripts
Fixes #1624.
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00