-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
weird transparent regions in kitty #1117
Comments
This could also be that we're assuming the cells to be the background color when we clear, which would be our bug (and I think there's a terminfo capability for detecting exactly that). So let's keep our minds open. |
The relevant capability is bce in terminfo, and you should not use it unless the terminfo advertises suport for it, which kitty's does not. |
@kovidgoyal awesome, i think you're quite correct. thanks for the pointer! i ought be able to have this fixed in 2.1.2. |
Hrmmm, I agree that this looks like failure to take Nonetheless, I still suspect that this might be a Notcurses problem. I'll look more deeply into it ASAP. |
Alright, some experimentation today indicates that this only happens with black cells. I.e. in the So the question becomes, am I properly emitting authentic RGB(0, 0, 0)/(0, 0, 0) spaces? Let's demonstrate that before going any further. |
Ok, in |
So for where we have the pink intermixed with the top text, we're rasterizing sequences of the form:
so here we see all the same foreground (0x97e7bc), because everything's coming from the bigtext plane, and we write long strings there based off the plane's attributes. so even the spaces have a set fg color. the background, however, is changing, where the "N" in "Notcurses II" comes up into the text. on either side, we've got 0x40000000 (explicit RGB(0,0,0) -- all 0s is "default background color"). within those two sides we have various red-dominated RGBs, exactly like what we see. so going into rasterization (i.e. the frame post-render), we've got the right values. the next thing to see is whether we're actually emitting the correct escapes. i'll debug on line 8 only. |
It looks like I'm definitely emitting the setbf(0, 0, 0), though only at the beginning of a string of (0, 0, 0)s:
so i definitely don't think |
so yeah, this is looking to me like a kitty issue. let me try to prepare a minimum test case. |
Alright, yeah, I think I've demonstrated that this is a kitty bug. Here's my minimal example:
this results in: when, so far as i can tell, this absolutely ought be pure opaque black backgrounds behind both "b" and the two following spaces. and in fact... that's exactly what i get if i use RGB(0, 0, 1) instead of RGB(0, 0, 0). so yeah, this looks pretty clearly to be kitty drawing default color instead of black for RGB(0, 0, 0) drawn with |
|
So the i'm gonna go ahead and file an issue on kitty based on this analysis. |
kovidgoyal/kitty#3185 has been filed. |
Ack, this is apparently intended behavior, see kovidgoyal/kitty@2045055. I've confirmed that in my config, if I replace any (0, 0, 0) with (0, 0, 1) in |
See kovidgoyal/kitty#3185 for more info, but basically:
so we could theoretically go down this road. one annoyance is that we'd have to somehow backconvert when people use (kitty has this behavior basically, AFAICT, to allow applications which don't use the default background color to get default background color effects. it's admittedly cool for old tools like alright. detect kitty based off TERM and expose that knowledge to the rasterizer. first, assume a default background color of 0,0,0, and get things working. later, we'll want to learn/set the actual default background color. |
Note that the default value of TERM for kitty is xterm-kitty, so |
Kitty conflates an RGB background specification that aligns with the default background color with that actual background color. This can result in translucent background when we're expecting opaque ones. Detect kitty (strstr check of terminal name for "kitty"), and if it's active, mark `bg_collides_default` with the rgb of the default background color. For now, we assume this to be (0,0,0), but we ought improve it by determining (or setting, if that's impossible) the precise default bg color. Closes #1117.
thansk for the assistance, @kovidgoyal . We're now detecting kitty based off the terminal name (we Verified that this eliminates our large transparent expanses (when using a 0, 0, 0 default background color) in the Calling this done for now! (Incomplete) fix is present in 2.1.2. |
You're welcome and just FYI, XTerm copied kitty's color stack this year, I just added support for the XTerm escape codes as well, to kitty. |
Kitty conflates an RGB background specification that aligns with the default background color with that actual background color. This can result in translucent background when we're expecting opaque ones. Detect kitty (strstr check of terminal name for "kitty"), and if it's active, mark `bg_collides_default` with the rgb of the default background color. For now, we assume this to be (0,0,0), but we ought improve it by determining (or setting, if that's impossible) the precise default bg color. Closes #1117.
When running
notcurses-demo
in Kitty, I get large unexpected transparent sections, almost always when blitting video. For example, the background of this video is expected to be an opaque black, but it is instead transparent (from thexray
demo).I suspect this to be an upstream bug, but I'm not going to file it as such until I can prove (and ideally fix) that.
The text was updated successfully, but these errors were encountered: