Warp icon indicating copy to clipboard operation
Warp copied to clipboard

Support Kitty Image Protocol / MIME Types / Rendering

Open zachlloyd opened this issue 4 years ago • 49 comments

https://sw.kovidgoyal.net/kitty/graphics-protocol/

zachlloyd avatar Jul 19 '21 15:07 zachlloyd

iTerm2 is able to display images (and animated gifs) within the terminal, see: https://iterm2.com/documentation-images.html.

It would be cool if this was supported within warp as well.

elviskahoro avatar Dec 07 '21 04:12 elviskahoro

@elviskahoro

Additional resources:

  • I know you are aware of notcurses. Aim to survive the notcurses-demo, it is a very good test of performance, Unicode support, 24-bit RGB, memory pressure, and images (both kitty and sixel).

  • If you choose to support sixel (perhaps from merging ayosec's graphics PR branch from alacritty), then you should also be aware of chafa . Among its encoders is an extremely fast high-quality sixel encoder. notcurses and chafa are the fastest encoders I know of, and have different performance characteristics on the high end. If you can keep up with both of them, then you will be in great shape.

  • If you choose either sixel or iTerm2, then you should also test against jexer . When I wrote Jexer's image backend, only 3 terminals survived its lots-and-lots-of-small-images approach. Now most terminals are working OK (though some still crash). If you retrofit ayosec's graphics PR from alacritty, it should work fine with Jexer-type output, but will not work fine for notcurses output due to how it treats partially-damaged images.

On a different topic, just so I don't spam you with junk:

  • Since you started from alacritty, you should be good with vttest now as they stopped crashing on it 5-ish years ago. But their coverage of vttest/VT100/xterm is still far from complete. If very good VT100/xterm coverage including VT52 submode is one of your goals, then you will need to go a bit past the Paul Flo Williams parser. (Specifically it does not have a state for the VT52 direct cursor address sequence, which isn't terminated like ECMA-48/ANSI X3.64 sequences are supposed to be.)

Looking forward to your success. :)

ghost avatar Feb 03 '22 18:02 ghost

@klamonte thanks for sharing!

elviskahoro avatar Feb 03 '22 19:02 elviskahoro

You're welcome. I'm rooting for you!

ghost avatar Feb 03 '22 19:02 ghost

From elna via Discord:

given that the UI framework can render arbitrary object, and like jupyter you have both a) a client server architecture and b) the notion of "cells", do you think you'll ever implement rendering of non-text based mime-types, e.g. svgs, pngs, ... for interactive plots like plotly?

https://discord.com/channels/851854972600451112/870145535993077780/885727936433500160

yes definitely although these two in my eyes are well solved by programs like https://github.com/antonmedv/fx and obviously nushell or https://www.visidata.org/, so I don't need warp to provide this - vs. e.g. a remote control API and support for a graphics rendering protocol which I need the terminal emulator to provide.

https://discord.com/channels/851854972600451112/870145535993077780/885728473463808020

https://github.com/joouha/euporie this is also a good inspiration which already works with kitty

https://discord.com/channels/851854972600451112/870145535993077780/885728712799166474

as is this https://github.com/dccsillag/magma-nvim

https://discord.com/channels/851854972600451112/870145535993077780/919330371647180832

https://github.com/tauri-apps/wry - how cool would it be if we could display html etc in warp? terminal based notebooks a la jupyter with rendering things like plotly plots would be possible

elviskahoro avatar Feb 04 '22 04:02 elviskahoro

https://gitlab.com/gnachman/iterm2/-/issues/6436

elviskahoro avatar May 10 '22 05:05 elviskahoro

Any updates on this? Really cool feature 😅

japanese-goblinn avatar Jun 27 '22 12:06 japanese-goblinn

@japanese-goblinn No updates. I'll share info in this github issue when there is. My guess is that this wouldn't be soon though.

elviskahoro avatar Jul 05 '22 04:07 elviskahoro

@japanese-goblinn No updates. I'll share info in this github issue when there is. My guess is that this wouldn't be soon though.

elviskahoro avatar Jul 05 '22 04:07 elviskahoro

@elviskahoro okey, thanks!

japanese-goblinn avatar Jul 05 '22 19:07 japanese-goblinn

From @wellcomez via #1754

Protocol iTerm2 extends the xterm protocol with a set of proprietary escape sequences. In general, the pattern is:

ESC ] 1337 ; key = value ^G Whitespace is shown here for ease of reading: in practice, no spaces should be used.

For file transfer and inline images, the code is:

ESC ] 1337 ; File = [arguments] : base-64 encoded file contents ^G The arguments are formatted as key=value with a semicolon between each key-value pair. They are described below:

elviskahoro avatar Aug 24 '22 04:08 elviskahoro

any updates on this? love this project but can't switch until this works :)

mikeal avatar Sep 27 '22 20:09 mikeal

No updates. This wouldn't be for awhile it's very high engineering lift!

warpdotdev-devx avatar Oct 11 '22 07:10 warpdotdev-devx

Is this one why emoji's are not rendering or should I open a new issue for it. Bascially Emojis are coming as wierd character please see bleow screenshot, where emoji should render as Aussie flag. CleanShot 2022-11-28 at 08 57 25

amjad1233 avatar Nov 27 '22 23:11 amjad1233

@warpdotdev-dx any updates??

p-i-c-o avatar Jul 23 '23 14:07 p-i-c-o

@p-i-c-o As far as I'm aware, there is some work being done on gif support, but nothing for kitty image support yet.

dannyneira avatar Jul 24 '23 23:07 dannyneira

It's honestly hard to take Warp serious if it does not offer the basics like rendering inline images, animated gifs, and images. I'd expect rendering to support pixel-based and character-based rendering both, with scaling, opacity control, caching for animations, etc. Even more, I'd expect pixel level R/W access to the terminal window (with plenty of security controls which makes this non-trivial). Also, plan now on how to support voxel rendering in the terminal because 3D matters.

There are some great comments above about the specifics around ensuring the terminal can perform very well with many hundreds of embedded / inline images. Yes, let's make it very fast please.

Think what we did with the C64 in the 80s... Let's see some radical stuff here!

scottbea avatar Aug 15 '23 19:08 scottbea

Ratatui, the Rust TUI framework, added experimental Sixel support as described here. I'm salivating at how great this would look in Warp! :D

RobbieMcKinstry avatar Aug 29 '23 15:08 RobbieMcKinstry

+1 I wish this feature

t0msk avatar Feb 23 '24 08:02 t0msk

any updates on this for warp?

sneazy-ibo avatar Feb 26 '24 09:02 sneazy-ibo

hmm its 3 years old feature request :( I mean modern terminal should support graphics rendering

t0msk avatar Feb 26 '24 09:02 t0msk

fr I got so many cli tools that use images, not having them visible on warp is really a pain

sneazy-ibo avatar Feb 26 '24 09:02 sneazy-ibo

need it, too

Cryolitia avatar Mar 01 '24 04:03 Cryolitia

I'm really surprised that warp does not already support this

ALEZ-DEV avatar Mar 02 '24 15:03 ALEZ-DEV

I'm really surprised that warp does not already support this

It should be a feature for a terminal that brands itself as "your terminal reimagined."

Ast3risk-ops avatar Mar 04 '24 13:03 Ast3risk-ops

Any update on this? Really need it

MilkTicc avatar May 14 '24 20:05 MilkTicc

Would definitely love to be able to use a tool like this in Warp:

https://github.com/hackerb9/lsix

bgyss avatar Jun 06 '24 18:06 bgyss

any updates on this for warp?

ZhangHanDong avatar Jun 12 '24 03:06 ZhangHanDong

I love Warp but having image support is necessary for it to become my daily driver.

Can we please get some kind of developer response here? This request has been sitting here for 3 years.

neuromuse avatar Jun 18 '24 03:06 neuromuse

yeah, would love to use warp but no image support, no chance. When i do Frontend Development i'm constantly in Yazi for blaszingly fast codebase searching with previews, will switch to warp the day image preview is available, without it its just not worth the tradeoff.

danscheer avatar Jun 22 '24 06:06 danscheer