Wezterm: Issues with window_background_opacity

Created on 28 Oct 2020  路  2Comments  路  Source: wez/wezterm

Describe the bug

I noticed when setting window_background_opacity, that the background does not change much from 1.0-0.6, when it goes below that value, the window is suddenly transparent.

I also noticed if i set a background color to e.g. red, and add a padding, the padding is black and the background red when window_background_opacity=1.0. If i set the value to 0.9 both the background and the padding is almost black, but starts to get more and more red towards 0.0.

Environment (please complete the following information):

  • OS: macOS
  • Version: 20200909-002054-4c9af461-239-g5b9c86d8

To Reproduce

Change the colors as i described.

Configuration

I only set window_background_opacity in the first test.

And then to test padding / background color i set:

  colors = {
    background = "#ff0000",
  },
  window_padding = { left = 100, right = 0, top = 0, bottom = 0, },

Expected behavior

I expected the background to gradually become more transparent when i changed window_background_opacity from 1.0 to 0.0, and not stay opaque and then jump from 0.6 to 0.5.

Also would expect the background + padding to always be red in the second test, and to gradually fade away when window_background_opacity goes towards 0, but still have the same color.

Screenshots

Only change window_background_opacity

window_background_opacity=0.7

Screenshot 2020-10-28 at 00 17 31

window_background_opacity=0.6

Screenshot 2020-10-28 at 00 17 01

window_background_opacity=0.5

Screenshot 2020-10-28 at 00 17 09

window_background_opacity=0.3

Screenshot 2020-10-28 at 00 17 19

Set window_background_opacity with padding and background color

window_background_opacity=1.0

Screenshot 2020-10-28 at 00 20 50

window_background_opacity=0.9

Screenshot 2020-10-28 at 00 21 08

window_background_opacity=0.5

Screenshot 2020-10-28 at 00 21 15

window_background_opacity=0.1

Screenshot 2020-10-28 at 00 21 22

bug

Most helpful comment

Thanks for this; the insight with the padding was the key in running this down; what was happening was the special "white space" glyph (black with 100% alpha) was being drawn to the background, modified by the configured opacity, instead of just the background color for the non-image-background case.

I've pushed a commit for that. I think that also resolves the overall "opacity cliff" where it took a significant amount of alpha adjustment to become transparent--I think that the "white space" glyph was an extra layer of black that had to be overcome.

It seems better to me on my little pixelbook Linux system than it was; hopefully you'll see that on mac too.

All 2 comments

Thanks for this; the insight with the padding was the key in running this down; what was happening was the special "white space" glyph (black with 100% alpha) was being drawn to the background, modified by the configured opacity, instead of just the background color for the non-image-background case.

I've pushed a commit for that. I think that also resolves the overall "opacity cliff" where it took a significant amount of alpha adjustment to become transparent--I think that the "white space" glyph was an extra layer of black that had to be overcome.

It seems better to me on my little pixelbook Linux system than it was; hopefully you'll see that on mac too.

I think you nailed it this time! The transperency looks great!

Was this page helpful?
0 / 5 - 0 ratings