haskellcamargo / sclack

The best CLI client for Slack, because everything is terrible!
GNU General Public License v3.0
2.45k stars 97 forks source link

Support iTerm2 image escape sequences #12

Open keegancsmith opened 6 years ago

keegancsmith commented 6 years ago

iTerm2 has extended the xterm protocol to support embedding images in the terminal. This seems like a great use in sclack if supported, instead of ANSI/VT100 rendering. https://www.iterm2.com/documentation-images.html

haskellcamargo commented 6 years ago

Yesterday I've been playing around with imgcat. It seems really easy to integrate in non-interactive interfaces or interactive interfaces that use the native ANSI escape codes of the terminal. Urwid is a bit specific. As long as I've searched, a custom widget using escape codes would need to use the urwid.Terminal widget as base, which provides its own parser for ANSI escapes, so buffering the output of imgcat and unbuffering inside a Urwid box doesn't render things like they should. I'll take a deeper look in the protocol the check the possibilities.

d0c-s4vage commented 4 years ago

You might want to checkout tiv https://github.com/stefanhaustein/TerminalImageViewer. I think its output looks better than imgcat's