Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kitty graphics: add support for shared memory transfer medium #2064

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

jcollie
Copy link
Collaborator

@jcollie jcollie commented Aug 8, 2024

Adds support for using shared memory to transfer images between the CLI and Ghostty using the Kitty image protocol. This should be the fastest way to transfer images if the CLI program and Ghostty are running on the same system.

Works for single image transfer using kitten icat:

kitten icat --transfer-mode=memory images/icons/icon_256x256.png

However trying to play a movie with mpv fails in Ghostty (although it works in Kitty):

mpv --vo=kitty --vo-kitty-use-shm=yes --profile=sw-fast --really-quiet video.mp4

mpv appears to be sending frames using the normal image transfer commands but always setting more_chunks to true which results in an image never being shown by Ghostty.

Shared memory transfer on Windows remains to be implemented.

jcollie and others added 2 commits August 8, 2024 15:38
Adds support for using shared memory to transfer images between
the CLI and Ghostty using the Kitty image protocol. This should be
the fastest way to transfer images if the CLI program and Ghostty are
running on the same system.

Works for single image transfer using `kitten icat`:

```
kitten icat --transfer-mode=memory images/icons/icon_256x256.png
```

However trying to play a movie with `mpv` fails in Ghostty (although it
works in Kitty):

```
mpv --vo=kitty --vo-kitty-use-shm=yes --profile=sw-fast --really-quiet video.mp4
```

`mpv` appears to be sending frames using the normal image transfer
commands but always setting `more_chunks` to `true` which results in an
image never being shown by Ghostty.

Shared memory transfer on Windows remains to be implemented.
@mitchellh mitchellh merged commit 71844a7 into ghostty-org:main Aug 8, 2024
5 of 7 checks passed
@mitchellh mitchellh deleted the kitty-graphics-shared-memory branch August 8, 2024 21:36
@mitchellh
Copy link
Contributor

Great work, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants