emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing image support for kitty terminal


From: Tomas Hlavaty
Subject: Re: Implementing image support for kitty terminal
Date: Wed, 07 Sep 2022 20:56:09 +0200

On Wed 07 Sep 2022 at 21:11, Eli Zaretskii <eliz@gnu.org> wrote:
> In particular, the current model of image display
> in the Emacs display engine is that an image is basically considered a
> single very large character, from the screen layout POV.

Are you talking about GUI emacs?
Is that not different in tty emacs?
I thought that the tty emacs has no concept of image (so far?).

> I guess
> that's not what you have in mind for the above, so IMO it's important
> to come up with an alternative model that would somehow fit with the
> current display code with only minor changes, if we want this not to
> be too complex.

For example, the tty based w3m web browser optionally supports images.
It reserves space w*h chars on the tty and then uses external program
to draw the image in the right place.

I guess tty emacs would also need to reserve a w*h chars rectangle on
the tty and then send the right escape code to fill that gap with the
image.

First, tty emacs would need to understand images instead of throwing
error.  At least their dimensions.  Maybe using some library or even in
elisp, for example like this
https://logand.com/sw/emacs-framebuffer/file/emacs-framebuffer.el.html#l286
I have not figured out, how to actually plug it into upstream emacs, as
this seems to require a lot of changes to C code.

Second, tty emacs would need to somehow reserve rectangle for the image.
This might be lots of work I guess.

Third, there would have to be a piece of code which actually draws the
image.  In case of kitty terminal, the image path and coordinates would
be sent to the tty using the kitty terminal protocol.  In case of Linux
console, the image path and coordinates would be sent to an external
program like w3mimgdisplay.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]