4 ms·
If you use a Mac, the Iterm2 terminal emulator has an additional protocol that supports rendering images [0]. It basically encodes the image with terminal esca
by gknoy 8y ago
If you use a Mac, the Iterm2 terminal emulator has an additional protocol that supports rendering images [0]. It basically encodes the image with terminal escape sequences, and also works for animated gifs.
Unfortunately, it seems to not be a standard - it would be neat if there were such a standard, and if other terminals could/would do similarly. It seems like the silliest thing but I like being able to easily indicate when my tests fail or not:
alias SUCCESS="echo -e '\n\nSUCCESS' \
&& imgcat ~/Pictures/success-100.png \
|| imgcat ~/Pictures/fail-100.png"
make test && SUCCESS
0: https://www.iterm2.com/documentation-images.html https://www.iterm2.com/documentation-images.html
- aumerle 8y agoSee https://sw.kovidgoyal.net/kitty/graphics-protocol.html https://sw.kovidgoyal.net/kitty/graphics-protocol.html for a much more comprehensive terminal graphics protocol
- gknoy 8y agoSlick :D Thanks for pointing that out!
- laumars 8y agoIt's not standard, but there are other terms with their own custom escape codes such as Terminology (from Enlightenment DE) and Kitty (not to be confused with KiTTY, the fork of PuTTY). There is also the sixel escape sequences will render using 6 pixel character blocks and is supported in xterm with the vt250 (iirc) support enabled. For what it's worth, xterm also supports vector graphics if you enable the right kind of VT mode. But that's a whole other discussion :)