-
Notifications
You must be signed in to change notification settings - Fork 59
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
Feature request (with working POC): display animated gifs in iTerm2 #54
Comments
Thanks for the detailed ticket, this is awesome! A few thoughts:
Anyhow, I think this would be a great addition but I'm mostly concerned about a) this only working in iterm2 and us having issue determining when to use each function in viuer b) the fact that the sync seems to be wrong, but we could probably solve this. |
For a), does I figured out the layout issue; I'm dumb -- it occurs when a block quote (or other element) wraps and this isn't taken into account for image placement (happens for non-gifs as well, even without this patch): Also, as written this code breaks presenting the demo from the git root, because the |
Yep, that should work. Looks like wezterm supports the iterm2 protocol so I should be able to test this on linux too.
Hmm the wrap around is expected but this should update the cursor location when that happens. I'll have a look.
Yeah this is intentional. I don't really want your presentation to break/work depending on what your Thanks for uncovering all these issues! |
Okay both gif support and the preformatted block wrap around bug are merged. Can you double check please? Thanks! |
I was trying to display a gif with presenterm in iTerm2, and found it rendered the first frame, but didn't animate it. It would be very useful if I could embed gifs in presentations.
viuer
is able to handle this case, but it seems to need to print from a file, as otherwise it encodes the image as a PNG. Here's how theviu
tool does it.This code has issues, but allows presenterm to display animated gifs in iTerm2. It also significantly speeds up loading slides that have large images on them, for some reason.
Screen.Recording.2023-11-21.at.2.20.03.PM.mov
Some things that the above code wants:
Testing/fallback for sixel support -- I couldn't get building
presenterm
to findlibsixel
so didn't go too far here.viu
has a fallback method it uses.Support for kitty protocol; I didn't test this at all
Correct positioning/resizing; this layout bug appears if there's not enough space:
Understanding of why this speeds up loading large PNG images, to make sure those gains are realized (i.e. maybe don't switch to only printing from file for gifs, but maybe for all iterm2 images?)
When you navigate to a slide with a gif, it takes a second for the gif to load in. Are there easy fixes for this? (Delay showing slide, have stand-in rectangle displayed so gif popping in is less jarring)
cat output
and get the gif displayed, and it still took ~1s.The text was updated successfully, but these errors were encountered: