Use custom image writers for kitty/iterm #157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This introduces custom code to write images when using the kitty or iterm protocols.
viuer
is still used for ascii blocks and sixel, but it would be nice to get rid of that dependency at some point. The initial motivation for this PR was to fix #153: the PR I made onviuer
(atanunq/viuer#53) has not shown any movement and the project is generally quite dead, I decided to implement this here instead. #153 is still open but with the ground work done on this PR it should be pretty easily fixable.The new features/improvements this PR adds are:
viuer
always performs some non negligible amount of work when printing images:--image-protocol
to bekitty-local
orkitty-remote
as now we can decide what to use rather than being tied to whatviuer
decides.Not that it really matters but the memory usage when running the demo presentation under kitty went down from ~15mb to ~14mb and the CPU usage when switching back and forth between the 2 slides in that presentation that contain an image went from ~3% to ~0.3%.