joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

Non-default color schemes obscure terminal graphics (e.g., Matplotlib plots) in Notebook #96

Closed zharmany closed 7 months ago

zharmany commented 7 months ago

Preface: This project is awesome and I'm really surprised at how far it's come!!

I ran into a somewhat baffling issue that was really hard to pin down - but I did it!

Using Kitty (v0.31), using any color scheme besides Default would obscure any graphical output. E.g., the output would look like blank space, but it was just the background color. Using any menus would show the neat sixle version behind the menu correctly, but go back to being "blank" once the menu was closed.

Graphics work just fine in Console and Preview.

Just theorizing, but I'm wondering if there's an order dependence or how the background color is being applied that causes Kitty to think the graphics output should be rendered "behind" the background. I noticed that during terminal resize events, the graphics would show briefly, then disappear, leading me to think it's happening during Notebook's redraw. Ctrl-l doesn't fix it either.

Anyway, thanks for all the hard work!

joouha commented 7 months ago

Hi!

Thanks for reporting this. Your theory about what's going on is exactly correct.

At some point during euporie's development (I don't remember why) it seemed necessary to set the z-index of graphics in kitty to -1073741824, which causes them the be displayed below cells with non-default background colours. This is no longer necessary, and is the cause of the bug you're seeing.

I've fixed this in 84bc5a909e2e85278573e4c6a1e3511ee2f540d2 in the dev branch. I'll published a new release with this fix in the next day or two.

joouha commented 7 months ago

This fix is in v2.6.0 which I released yesterday

zharmany commented 7 months ago

Awesome; I'll check it out!