thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

Is it possible directly display image in the terminal without opening a new window? #539

Closed TommyJerryMairo closed 3 years ago

TommyJerryMairo commented 6 years ago

Like this one:

example

jelly commented 6 years ago

I believe that requires sixel report, what terminal is this even?

egmontkob commented 6 years ago

And what ls command?

(I guess it's just a mockup based on gnome-terminal, created in gimp or something similar.)

egmontkob commented 6 years ago

See GNOME bug 729204 (and follow the links from there for additional information) for the status of sixel support in VTE. There's a patch which I haven't tried, but based on the discussions there, I'm not super keen on adding graphics support to VTE. It might end up landing there, though. But then it'd still need a corresponding variant of ls.

Several terminal emulators (including terminology and kitty) have also implemented their own graphics format, along with corresponding tools (e.g. tyls).

Alas no standard seems to emerge that doesn't suck big time (sixel is so last millennium that it hurts), probably due to the model/view split mentioned/linked from the aforementioned bug it just cannot be done right.

Particularly for ls, there's something to consider:

Newest VTE versions support explicit hyperlinks (#476), and so does the latest version of coreutils's ls. It outputs the filenames as usual, but each of them are hyperlinked to the corresponding file.

On top of this, termite could show a preview of the given file on mouseover (khm, I mean some keyboard shortcuts). gnome-terminal has a proof of concept patch (that is: working, but not ready for mainstream inclusion) for this. Maybe termite could implement it properly. (Of course I understand it's pretty different from what the original reporter wishes to have, but this one is at least reasonably doable.)

lowfatcomputing commented 6 years ago

@egmontkob possibly an alias to lsix. I was using it in termite with the experimental sixel support before the vte/vte-ng split.

egmontkob commented 6 years ago

@lowfatcomputing Thanks for pointing me to lsix, I've never heard of it.

(By the way I still think the above screenshot is a mockup. The font is the same as the terminal's, yet not aligned vertically to the character cells of the prompt, and not aligned nicely to the pictures either. Plus the files aren't in alphabetical order... It's pretty irrelevant for the feature request though.)

robin-a-meade commented 6 years ago

The mockup is from here: https://askubuntu.com/q/97542

dtzWill commented 6 years ago

The vte-ng patches are minor and can be applied pretty easily, it turns out.

If you'd like, you can try building with my fork: vte-sixel-ng which worked well enough in daily use for.. actually exactly 1 month today! Ha! :).

I'm actually moving away from it since I didn't find many uses. But it's neat! :+1:

FWIW my fork also rips out the "reaper" kludge which was causing problems on my platform. On glibc-linux removing it also fixes the source of this fun error/warning:

(termite:27242): GLib-WARNING **: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). Most likely the process is ignoring SIGCHLD, or some other thread is invoking waitpid() with a nonpositive first argument; either behavior can break applications that use g_child_watch_add()/g_spawn_sync() either directly or indirectly.

Anyway just heads-up so no one feels I snuck it in there :).


While I'm showcasing my patch rebasing skills :laughing: here's a branch applying the ng patches to 0.51.3: https://github.com/dtzWill/vte-sixel-ng/tree/0.51.3-ng

GLHF! Apologies if anything breaks, use at your own risk, etc.

jelly commented 6 years ago

Cool, it would be nice if VTE merged this, as I'm becoming less and less interested in maintaining vte-ng.

lowfatcomputing commented 5 years ago

@jelly as an alternative to vte and vte-ng there is mlterm which can output a vte compatible library. Mlterm has the most complete and least buggy implementation of sixel graphics and pixelwise mouse support of the terminals/libraries I have tried (xterm, urvxt, st, vte).

It's likely that the mlterm devs would be more receptive to exposing functionality such as keyboard text selection and URL hints than the libvte devs appear to be.

I haven't tried building termite with mlterm-vte and I think it would be a good idea to run vttest with libvte and mlterm-vte to know what to expect for feature parity.

http://mlterm.sourceforge.net/ https://bitbucket.org/arakiken/mlterm https://bitbucket.org/arakiken/mlterm/src/tip/gtk/README?fileviewer=file-view-default

bestouff commented 5 years ago

(By the way I still think the above screenshot is a mockup. The font is the same as the terminal's, yet not aligned vertically to the character cells of the prompt, and not aligned nicely to the pictures either. Plus the files aren't in alphabetical order... It's pretty irrelevant for the feature request though.)

I rather think it's directly from MacOS's Iterm2 terminal emulator which has great image support, see protocol documentation here: https://www.iterm2.com/documentation-images.html (as well as many other more or less useful proprietary escape codes).

thestinger commented 3 years ago

Termite is obsolete. Please use Alacritty instead. See https://github.com/thestinger/termite#termite-is-obsoleted-by-alacritty for more details.