-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Images/graphics are not cleared up inside tmux #2457
Comments
clear clears all images. If it does not work with tmux that will be |
I know. As I said, tmux is a big trouble. But why closing this issue? Could you please reopen it or discuss some workaround or about adding more batteries?
Anyway, what
It has no effect inside tmux. Still the "ghost" graphics are not cleared up. |
There's nothing I can do about issues tmux creates. If you wish to discuss workarounds for tmux, feel free to do so, but this is not a kitty issue. Using clear and icat --clear both work without tmux. That's more than enough ways to clear images, as provided by kitty. |
tmux says that it is not a problem of theirs and so does kitty. But thanks for letting me know the clear sequence used in kitty. Although this is a tmux create, I think kitty is fully responsible of cleaning up all graphics garbages created by whatever reason. So the following sequence -- must be wrapped by tmux passthrough sequence protocol -- works for clearing all graphics: >>> sys.stdout.buffer.write(b'\033Ptmux;\033' + b'\033_Ga=d,d=A\033\033\\' + b'\033\\') but only if the graphics are in display. In other words, in the presence of the "ghost" black graphics (where the actual images are gone) for some reason (e.g. deattach and reattach, or scroll a lot), the control sequence would not clear up them. I think this is just a small bug, but do you think it would be fixable? |
On Sat, Mar 21, 2020 at 09:23:58PM -0700, Jongwook Choi wrote:
[tmux says](tmux/tmux#1391) that it is not a problem of theirs and so does kitty. But thanks for letting me know the clear sequence used in kitty. Although this is a tmux create, I think kitty is fully responsible of cleaning up all graphics garbages created by whatever reason.
tmux is interfering with the escape codes sent by the applications
running in the terminal. If they do that, then it is their problem to
fix the resulting breakage. Terminal multiplexers are an *extremely* bad
idea that both breaks things and wastes energy. I have said so plenty of
times before and will continue to say so.
So the following sequence -- must be wrapped by tmux passthrough sequence protocol -- works for clearing all graphics:
```python
>>> sys.stdout.buffer.write(b'\033Ptmux;\033' + b'\033_Ga=d,d=A\033\033\\' + b'\033\\')
```
All escape sequences are documented, https://sw.kovidgoyal.net/kitty/graphics-protocol.html
but only if the graphics are in display. In other words, in the presence of the **"ghost"** black graphics (where the actual images are gone) for some reason (e.g. deattach and reattach, or scroll a lot), the control sequence would not clear up them. I think this is just a small bug, but do you think it would be fixable?
There are no ghost graphics, if there are, then it is a bug and should
be fixed. One such bug was recently fixed in master, look for the
commits from the last couple of days.
|
Thanks Kovid. With due respect, I would say I don't think terminal multiplexer is a bad idea. But I understand why you believe so. This is beyond this issue's scope, so let's stop the argument here. I tried the latest master as of 3/21 and yes, the bug is no more present (all graphics are cleared). Seems fixed in #2449. For the v0.16.0 release I can always confirm the bug exists, so we can say everything is okay from v0.17. Now I think I have all toolsets I needed. Thank you for your help again! |
@wookayin Display an image, then try scrolling in tmux and see what happens... or display an image with a height greater than the tmux pane's height. My point is... it's mostly futile trying to make the graphics protocol work in tmux if its maintainers decide not to do something about it (which would actually be quite a hell of work for them). |
I know tmux is a big headache when it comes to implement features involving escaping sequence. Somehow I managed to prototype the image preview feature in tmux (#413) work on kitty, via tmux passthrough sequence. Yay!
However there is a problem with images: it does not get cleared up after
<Ctrl-L>
(clear).So it either stacks up:

or after reattach/deattach/split panes/or whenever re-rendering happens:
a black image hides everything.
It seems that there is something weird happening in dealing with clear sequence. Any ideas for workaround?
FYI, iTerm2 simply clears up all rendered images whenever the graphics gets out of the screen (e.g., scrolled up, detach, redraw, clear, etc.). Another workaround is to have a feature to manually clean up the rendered graphics (via mouse pop-up menu or some command lines).
The text was updated successfully, but these errors were encountered: