Hacker News new | ask | show | jobs
by krilly 2306 days ago
On imgcat, those extensions to the xterm protocol[0] seem really nice. I've long thought that there needs to be a simple escape sequence for a horizontal divider that doesn't break upon resizing, they should do that next!

Also check out tiv[1] which is an alternative that works with any unicode terminal.

[0]: https://www.iterm2.com/documentation-images.html

[1]:https://github.com/stefanhaustein/TerminalImageViewer

1 comments

These iterm image extensions are almost there. It is unfortunate that it can only display files, and not image created on the fly (i.e., you dump all the pixel values into the terminal and it shows an image).
The actual extension does support images created on the fly. All that's missing is some commandline tool that'll translate from whichever format it's in to the format iterm expects. For e.g. a PNG image data you could probably get away with a single-line bash script: all it has to do is stick an escape sequence in front of the base64 encoded file contents.
that's great! I hope it will be implemented for xterm and becomes a sort of standard. Sometimes I use "sixels" but they are hopelessly slow and low-resolution.

Not much a fan of the base64 encoding here. I'd prefer if it was the pixel binary buffer data that you output directly, pinching a hole in the terminal protocol. The fact taht it is binary does not pose problems if the escape sequence contains the size of the image.