4 ms·
Aside: Although iTerm2 (on macOS) doesn't appear to work with this, iTerm2 actually supports full-color inline images, and has an "imgls" script which does some
by isomorphic 8y ago
Aside: Although iTerm2 (on macOS) doesn't appear to work with this, iTerm2 actually supports full-color inline images, and has an "imgls" script which does something similar. (There's also "imgcat".)
https://www.iterm2.com/documentation-images.html https://www.iterm2.com/documentation-images.html
- cyphar 8y agoThis is because iTerm2 doesn't support sixels (which is part of a VT standard I believe), and instead has its own custom version of the same thing.
- xzfc 8y agoNot quite the same. iTerm provides escape sequence to inline base64-encoded images in a common format (e.g. PNG)[1] whereas Sixel is an it's own image format. I find iTerm's approach is more simple yet more powerful: better compression, thus faster; no dithering, thus better image quality; it's even have GIF support. Sixel is an 30 year protocol designed for matrix printers, i'm not sure why we should stick to it. I think terminal emulators should adopt iTerm escape sequence rather than Sixel. Aside of iTerm, image inlining is supported in Terminology[2]. Not sure about compatability with iTerm however. [1]: https://www.iterm2.com/documentation-images.html https://www.iterm2.com/documentation-images.html [2]: https://www.enlightenment.org/about-terminology.md https://www.enlightenment.org/about-terminology.md
- osiutino 8y agoI used the imgcat trick in my shell client project (https://github.com/u59u75u65/hkgbox-rs https://github.com/u59u75u65/hkgbox-rs). I was looking for a cross platform solution, but by the time I worked on it I didn't know Sixels. One of the things that is cool about imgcat is that it handles GIF animation by default.
- fouc 8y ago>iTerm2 extends the xterm protocol with a set of proprietary escape sequences. I wonder if any other terminal uses the same escape sequences. If not, why not?
- geofft 8y agohterm, the terminal emulator portion of the Chrome (OS) Secure Shell app, supports them. (Aside: I dislike the vagueness of the term "proprietary." I rarely hear anyone call the non-ANSI VT-100 or xterm sequences "proprietary," even though they got started in exactly the same way as iTerm2's.)
- jcoffland 8y ago> I dislike the vagueness of the term "proprietary." iTerm2 calls their escape codes proprietary[0]. As far as I can tell, they are not trying to create a standard. VT320, on the other hand, is an ANSI standard[1]. [0] https://www.iterm2.com/documentation-escape-codes.html https://www.iterm2.com/documentation-escape-codes.html [1] https://en.m.wikipedia.org/wiki/VT320 https://en.m.wikipedia.org/wiki/VT320
- gnachman 8y agoSome day they'll be standards and I'll change the documentation to say "perfectly normal" instead of "proprietary" :)
- pmarin 8y agoIt's probably a matter of writing a proper RFC like document. That is how standards should be made.
- laumars 8y agoIt’s worse than that, there’s other shells that support their own ANSI escape sequence for transferring base64 encoded images: kitty (not to be confused with KiTTY - the PuTTY fork) and Terminology (of enlightenment DE) each have their own “standard” and they differ from iTerm2’s. They all have their own CLI tools too. Then there is sixel - which solved a problem back when TTYs were VDUs but aren’t really suitable for a modern era where it’s all terminal emulators running on (U)HD displays. I don’t think sixel support is all that widespread though but happy to be corrected there. What we really need is one CLI tool to rule them all. One tool that will detect the shell you’re using and default to the best escape sequence for that shell; falling back to ASCII art when all else fails. This is something I’ve been actively working on in some of my spare time but it’s not ready for public consumption, yet....
- gnachman 8y agoI've been meaning to add sixel support since forever, but I like my way of doing it so much more because it supports the file formats people use, which are generally a much better encoding than sixel. That being said, this is nicer than iTerm2's equivalent (called imgls) because it re-encodes the image to make it smaller over the wire. That being said, I'd rather use a lot of bandwidth than have to install imagemagick everywhere. That's probably just my bias against dependencies showing :)
- shocked-pikachu 8y ago_imgcat_ example shows a dog