Commit Graph

86 Commits

Author SHA1 Message Date
Sergei Grechanik
63cc5d7e49 Fix erasure of unicode placeholder images on reset 2023-09-03 15:33:30 -07:00
Kovid Goyal
951951776a Ensure group_count is never zero in any ImageRef
Now group_count means the number of refs pointing to the same image from
that ref onwards. This is needed because we can index the list of refs
at any point when drawing not just at the start of a group.

Fixes #6594
2023-09-02 12:48:44 +05:30
Kovid Goyal
af724090d2 Add a non-delete test as well 2023-06-14 09:44:51 +05:30
Kovid Goyal
4c5f4c4baf Apparently Python 3.12 no longer raises FileNotFoundError when closing a deleted file
Fixes #6360 (I hope) dont have time to actually test with pre-release
python builds
2023-06-14 08:06:47 +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
a068e3e655 Fix issues reported by ruff 2023-01-09 15:54:41 +05:30
Sergei Grechanik
32d8aac808 Fix scrolling images within margins
This commit fixes an off-by-one error in image scrolling that caused
images to not be scrolled or to be cropped at the wrong line.
2022-12-25 15:34:54 -08:00
Kovid Goyal
d0c50248ea Graphics protocol: Only delete temp files if they have the string tty-graphics-protocol in their file paths.
This prevents deletion of arbitrary files in /tmp via the graphics
protocol.
2022-08-16 11:25:33 +05:30
Kovid Goyal
362c4147e4 ... 2022-01-08 12:21:55 +05:30
Luflosi
e82e57a30c Remove unused code
Since 99d9cb0b0d runs all tests with HOME set to a temporary directory, this code setting the cache directory to a temporary directory is no longer needed. `cache_dir()` will choose a directory in the home directory if neither KITTY_CACHE_DIRECTORY or XDG_CACHE_HOME are set.
2021-10-31 11:42:55 +01:00
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
340159b591 Graphics protocol: Support for frame composition
Fixes #3809
2021-07-22 18:58:59 +05:30
Kovid Goyal
1d9626d493 Graphics protocol: Fix image without placements being deleted when screen scrolls 2021-07-10 14:05:53 +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
9fdaef1da6 Graphics protocol: Fix suppression of responses not working for chunked transmission
Now the starting escape codes q value is used unless the last escape
code specifies a non-zero q value of its own. Fixes #3375
2021-03-10 09:58:49 +05:30
Kovid Goyal
38992e25d7 Make the tests into a package
Useful to make the tests runnable in a frozen build.
2021-02-19 14:35:25 +05:30
Kovid Goyal
625f0f77bb Ensure disk cache is cleared 2021-02-19 09:43:57 +05:30
Kovid Goyal
0341b64748 Allow caching of disk cache entries in RAM 2021-02-18 10:22:42 +05:30
Kovid Goyal
fe07306ff1 Use a nicer decorator for functions that only need to be run once 2021-02-05 10:40:52 +05:30
Kovid Goyal
4ba35d4a93 Clear cache_dir lru cache when testing 2021-02-05 09:56:17 +05:30
Kovid Goyal
67ca1902a0 Use a cache dir in the cwd on CI 2021-02-05 09:42:01 +05:30
Kovid Goyal
1ef326e220 Better error message 2021-02-05 09:29:56 +05:30
Kovid Goyal
7a1785e1e8 Get chunked loading working with frames 2021-02-04 21:04:44 +05:30
Kovid Goyal
19f0e2303d Refactor to store frame deltas instead of fully coalesced frames
Trades CPU usage for cache/memory space
2021-02-03 15:49:33 +05:30
Kovid Goyal
bb5c5a8e4f Allow gapless frames 2021-02-01 16:22:36 +05:30
Kovid Goyal
00edb6058e Start work on implementing frame transitions
Also ensure that the correct OS Window is current when uploading images
to GPU.
2021-01-31 20:58:42 +05:30
Kovid Goyal
597267d1d0 root frame gap should be set to the gap of the first received frame 2021-01-31 20:58:42 +05:30
Kovid Goyal
b21850dd15 Implement updating of current frame on GPU 2021-01-31 20:58:42 +05:30
Kovid Goyal
4098f2d383 Add quota enforcement testing 2021-01-31 20:58:42 +05:30
Kovid Goyal
5eba754c60 Implement animation control escape codes 2021-01-31 20:58:42 +05:30
Kovid Goyal
1d20472759 Avoid a cache move when deleting frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
d76e757d53 Implement delete for frames 2021-01-31 20:58:42 +05:30
Kovid Goyal
17f485d614 Basic frame loading works 2021-01-31 20:58:41 +05:30
Kovid Goyal
35f3312a1e Use shorter cache keys 2021-01-31 20:58:41 +05:30
Kovid Goyal
ca3c49099f Start work on tests for frame loading 2021-01-31 20:58:41 +05:30
Kovid Goyal
5a182d3d13 Store image data in a disk cache 2021-01-31 20:58:41 +05:30
Kovid Goyal
d68c338304 Wait for write and check data, fixes test failure 2021-01-04 12:27:26 +05:30
Kovid Goyal
ac13ae727f Fix failing test
We cant know what the size of the disk cache file is,
since defragmentation occurs asynchronously
2021-01-03 21:05:08 +05:30
Kovid Goyal
1b59a1c421 Finish tests of disk cache 2021-01-03 17:36:40 +05:30
Kovid Goyal
c869774c58 More tests for the disk cache 2021-01-03 06:22:48 +05:30
Kovid Goyal
18679348b2 Use usleep rather than nanosleep 2021-01-03 05:00:40 +05:30
Kovid Goyal
8f58140419 Start work on tests for disk cache 2021-01-03 04:28:48 +05:30
Kovid Goyal
fe1050fc0e More work on disk cache 2020-12-30 14:26:38 +05:30
Kovid Goyal
e82a6dedd9 Fix deletion with image numbers 2020-12-16 18:57:46 +05:30
Kovid Goyal
d10681f27f Send responses when only a number and no id is specified 2020-12-16 18:31:30 +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
4a60413e0b ... 2020-12-03 21:38:42 +05:30
Kovid Goyal
245f5d60b5 Add a test for image put + delete + put 2020-12-03 21:37:32 +05:30
Kovid Goyal
23420adfa6 Graphics protocol: Allow suppressing responses from the terminal to graphics commands 2020-12-03 20:42:03 +05:30