Kitty icat 与 TUI 的 emacs 配合

想请教坛友使用 TUI 的 emacs 时,有没有什么便捷的方法使用 kitty icat 展示图片呢?

我看到有这个帖子的讨论,但是是在 2022 年,感觉有点旧。

需要 emacs tty 支持 kitty image protocol。

可以 track 这个邮件列表的进度: Implementing image support for kitty terminal

注意到 eli 提到了在 tty 实现对图形的支持需要考虑到这个问题:

That’s exactly the problem: it currently assumes that no display element takes more than one row, and that each row is exactly one pixel (= one character height) tall. So the change will/would need to make the glyph matrices (and their generation) more like those used in the GUI code.

That’s the “hard way”. It will require changes in many places that assume the current TTY geometry of the glyph rows. The problem, I think, is not with generating the matrices, it’s with using them, and with adjusting features like scrolling, that currently assume all screen lines have the same height, to this change. I hoped we could avoid that, but maybe not.

谢谢,我也看到这个帖子了,不过似乎“改造 emacs tty”这个思路没啥实现?我想知道有没有什么 workaround。

icat它并不会返回任何图片对象,它只是让kitty画了个图。这个过程只在kitty内部进行,从外面不好抓的。TUI支持图片困难就难在这里,因为图片是由终端去画的。这个协议叫做sixel,如果你感兴趣可以试试用这个库写个module。

或者你可以考虑在其它窗口里显示图片,比如在Emacs里面运行M-! feh <image>启动feh查看图片。

如果你是远程窗口里运行服务器上的Emacs,那就C-z切后台回到shell,icat看图,fg切回去。

kitty 使用的协议叫 kitty image protocol。sixel 协议比较老旧了,很多 kitty image protocol 能支持的东西都不支持。

非常期待这个功能,如果有这个功能我的远程workflow就完善了。不过看邮件列表的意思好像近期不会实现