-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
icat without TIOCGWINSZ ioctl #413
Comments
As far as I know, there is no reason why tmux should not be able to pass on pixel sizes via TIOCGWINSZ, all it has to do is get the size from the parent terminal, calculate the size of a block, do the multiplication to get the window size in pixels for each window it is displaying and set the pixel sizes when it is calling TIOCSWINSZ. That is does not do so is a bug in tmux. While I can certainly add escape codes to the graphics protocol to query block sizes, doing so is unnecessarily slow compared to using the IOCTL and also leads to code duplication/complication just to work around a bug in other software. |
@kovidgoyal Given that in the tmux repo this issue was closed, is kitty going to change the approach taken? Given that this looks like an issue that will go back and forth between tmux and kitty otherwise |
Nope, tmux has said it does not want to support the display of images. I am not going to complicate kitty's code to try to work around that. Indeed, one of my goals with kitty is to remove the need for hacks like terminal multiplexers completely, as they just act as a drag on the entire terminal ecosystem, and waste CPU cycles. Every byte between the application and the terminal emulator has to be parsed by an extra multiplexer middleman. And every new feature a terminal tries to implement now has to be implemented in multiple places. kitty is already pretty close to the goal of completely replacing a terminal multiplexer, the only missing piece is #391. Someday if I get annoyed enough, I might just implement it. |
@kovidgoyal Although you don't have any plans on that topic and although this is a tmux-wise problem, I still suggest you to implement a workaround. I don't think kitty's tab/window system is featureful enough to replace with tmux, so we can't just get rid off tmux completely at this stage. |
As far as I know kitty's tab/window system is a strict superset of tmux's. If there is some feature you are missing, feel free to request it. I am much more likely to implement that. |
Oh and I should note simply working around tmux's stubbornness for the TIOCGWINSZ issue wont make it magically support images. There will still be lots of other problems when using multiple windows in tmux. This is because images have to be placed, just like the cursor. tmux has to intercept and rewrite cursor positioning escape codes to implement windows, it would have to do the same for image escape codes. And its devs have said they dont want to do that. Unlike TIOCGWINSZ, that is not an issue that can be worked around in kitty. |
@kovidgoyal I don't understand what you mean by it not being a problem that can be worked around in kitty. I use termite and images render perfectly well through tmux. For example in my file browser ranger I see image previews. This is probably the last feature that keeps me from switching to Kitty, and I'm curious why it's such a big deal for Kitty to do what other terminals seem to do. Is it just a lot of work? If so maybe I can work on it. |
Image display works via a protocol https://sw.kovidgoyal.net/kitty/graphics-protocol.html this protocol specifies where and how to display images inside terminal windows. tmux splits up terminal windows into multiple panels. Therefore it will need to intercept and re-write those escape codes to move the images around, at a minimum. Just like is to does for escape codes that position the cursor. tmux developers have said they dont want to do that. Once again, terminal multiplexers are an awful idea. |
I'm saying displaying images works as expected in other terminals, even in tmux sessions. It has worked for me in termite, urxvt, terminator, terminology, and xterm, all while within tmux sessions. I guess I just don't understand why it's something you are against supporting but many other terminal developers are fine with it. |
Sigh. Feel free to come up with a patch that makes images magically work Just FYI, ranger on those terminals bypasses the terminal and displays |
My apologios @kovidgoyal, ranger actually does render images inside tmux while using Kitty. My issue ended up being a non-issue, and just something I had going on in my environment at the time. Thanks for all of your great work on this incredible project. |
Hi, @kovidgoyal, have you made ranger render images inside tmux while using KItty? May I ask what was the key? |
I dont solve it and no it is not possible as long as tmux does not add |
Ah! Sorry. (+ Thanks for the incredible terminal) I was going to ask to @rodrijuarez, but confused. @rodrijuarez Could you answer my question above? |
for what it's worth, |
Once could get hacky single window support for images by using tmux's passthrough escape codes wookayin/python-imgcat#4 but it will ofcourse fil if using more than single tmux window. |
Even with the passthrough... the following still won't work:
|
A possible solution to making icat work without exact pixel size would be to find the width and height of the block in pixels and multiplying rows by width and columns by height. this would allow for icat to work within tmux.
The text was updated successfully, but these errors were encountered: