Skip to content
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

Modals show up behind images in kitty terminal #153

Closed
mfontanini opened this issue Jan 17, 2024 · 0 comments · Fixed by #157 or #158
Closed

Modals show up behind images in kitty terminal #153

mfontanini opened this issue Jan 17, 2024 · 0 comments · Fixed by #157 or #158

Comments

@mfontanini
Copy link
Owner

The kitty graphics protocol treats images as non cell-based entities and therefore if you write an image at position (x, y) and then move the cursor back to (x, y) and write text, it won't overwrite the image. In order to control image stacking, it uses z-indexes so that you can specify whether an image is on top of text, in between the text and the background, or behind the background (and also image over image stacking but we don't care). This causes every application that uses the kitty protocol and needs the use of a modal to have extra code to deal with this, see the discussion here kovidgoyal/kitty#6988.

Unfortunately, viuer doesn't currently support z-indexes (I created a PR for this here atanunq/viuer#53), so the plan to get around this behavior in kitty is:

  • Wait until that viuer PR is merged or alternatively fork viuer as the project seems quite dead and there's other things I've thought of adding/I think its API could use some rework so it's more flexible and more tailored to apps that want to write multiple images/the same image multiple times.
  • Once we can control z-indexes via either of the solutions above, create a new RenderOperation that's something like "fill.. with... transparent...something" which takes a rect and will, only if we're in kitty mode, print a semi transparent image over that rect with a z-index greater than what we normally use but also negative so it shows up behind text.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant