toot icon indicating copy to clipboard operation
toot copied to clipboard

Feature Request: Display images inline in terminals that support it

Open stevecheckoway opened this issue 3 years ago • 6 comments

Some terminal emulators support displaying images in the terminal via an extension of the xterm protocol. It would be great if the TUI would display such images.

Partial list of terminal emulators that support displaying images in some fashion

  • iTerm2
  • Kitty
  • Several support SIXEL, including xterm (and I read a comment that KDE's Konsole supports it as well)

stevecheckoway avatar Nov 11 '22 00:11 stevecheckoway

Added a patch for this. You'll need to install a companion viewer app, 'chafa' available in most distros and https://github.com/hpjansson/chafa

With chafa and this patch you get surprisingly good character graphics in most terminals, but in iTerm2, Kitty, etc. you get pixel accurate images.

https://lists.sr.ht/~ihabunek/toot-discuss/%3Ceb069b5d-4d40-63b4-21e1-d1375c16c742%40mini%3E

danschwarz avatar Nov 27 '22 03:11 danschwarz

I'd like to add The Enlightenment Terminal, Terminology to that list, which also supports images, sound, and videos via Terminal Control Sequences. Terminology can usually be detected if the environment variable TERMINOLOGY is set to 1

ChristianSilvermoon avatar Nov 28 '22 05:11 ChristianSilvermoon

Terminal support is entirely within the helper program; if you like you can test chafa with a jpg on your local system and see how it performs.

danschwarz avatar Nov 28 '22 12:11 danschwarz

Terminal support is entirely within the helper program; if you like you can test chafa with a jpg on your local system and see how it performs.

image I am genuinely really impressed with it, but for Terminals with native image support it doesn't seem the most ideal :thinking:

ChristianSilvermoon avatar Nov 28 '22 13:11 ChristianSilvermoon

Terminology uses a unique protocol to display images - it doesn't use the Kitty, iTerm, or sixel protocols supported by chafa. I can add support for tycat to my patch and you can use that instead of chafa.

danschwarz avatar Dec 02 '22 16:12 danschwarz

This looks like something that NotCurses could do.

https://notcurses.com/

hackdefendr avatar Feb 18 '23 15:02 hackdefendr