Support Kitty's Unicode placeholders feature and support running loooooooongcat within tmux - #48
Conversation
yoichi
commented
May 23, 2025
Unfortunately it didn't work in my environment. I confirm that CheckKittyGraphicsProtocol returns false and it was reaching the code path with "If we didn't get the graphics response, assume no support" comment. Is there anything else I should look into? |
yoichi
commented
May 23, 2025
yoichi
commented
May 23, 2025
I found that I must set allow-passthrough option of tmux. ![]() Then it works! ![]() |
| } | ||
| defer term.Restore(fd, state) | ||
| // Wrap graphics query for tmux if necessary |
There was a problem hiding this comment.
Currently, option settings are required, so I thought it would be a good idea to add a comment like the one below.
// Requires the allow-passthrough option set to on or all for this to work// https://github.com/tmux/tmux/wiki/FAQ#what-is-the-passthrough-escape-sequence-and-how-do-i-use-itAfter this change, with Terminal.app on macOS, longcat stops processing at If I press some key, then the image is displayed in pixterm mode as before. |
- Route kitty graphics protocol and cell size queries through a QueryTerminal hook instead of duplicating terminal I/O. - Drop the leaking reader goroutines and reads from os.Stdout. - Restrict the graphics protocol probe to tmux to avoid mishandling on terminals such as Terminal.app. - Query cell size only in Unicode placeholder mode.



Tested with Ghostty terminal and tmux version=3.5a 🐱🐱🐱🐱🐱
Document: https://github.com/kovidgoyal/kitty/blob/04fbf63eabc8ec6120ca39ace3508c45384edf42/docs/graphics-protocol.rst#unicode-placeholders