Running pywal makes window transparent #434

Closed
opened 7 months ago by dnkl · 1 comments
dnkl commented 7 months ago
Owner

Running pywal (with any theme, I believe) makes all foot windows transparent.

Running pywal (with any theme, I believe) makes all foot windows transparent.
dnkl added the
bug
label 7 months ago
Poster
Owner

The reason: 4997a49eb7/pywal/sequences.py (L50-L60)

    sequences.extend([
        set_special(10, colors["special"]["foreground"], "g"),
        set_special(11, colors["special"]["background"], "h", alpha),
        set_special(12, colors["special"]["cursor"], "l"),
        set_special(13, colors["special"]["foreground"], "j"),
        set_special(17, colors["special"]["foreground"], "k"),
        set_special(19, colors["special"]["background"], "m"),
        set_color(232, colors["special"]["background"]),
        set_color(256, colors["special"]["foreground"]),
        set_color(257, colors["special"]["background"]),
    ])

The last two lines results in OSC-4 sequences with indices 256 and 257, both of which are invalid.

Foot doesn't verify the OSC-4/104 color indices are valid, resulting in "index of out bounds" accesses:

../../osc.c:600:17: runtime error: index 256 out of bounds for type 'uint32_t [256]'

This thrashes the alpha member in the terminal struct, causing the windows to turn transparent.

The reason: https://github.com/dylanaraps/pywal/blob/4997a49eb7479ccda1228f064d6c50e1abedc5b4/pywal/sequences.py#L50-L60 ``` sequences.extend([ set_special(10, colors["special"]["foreground"], "g"), set_special(11, colors["special"]["background"], "h", alpha), set_special(12, colors["special"]["cursor"], "l"), set_special(13, colors["special"]["foreground"], "j"), set_special(17, colors["special"]["foreground"], "k"), set_special(19, colors["special"]["background"], "m"), set_color(232, colors["special"]["background"]), set_color(256, colors["special"]["foreground"]), set_color(257, colors["special"]["background"]), ]) ``` The last two lines results in OSC-4 sequences with indices **256** and **257**, both of which are invalid. Foot doesn't verify the OSC-4/104 color indices are valid, resulting in "index of out bounds" accesses: ``` ../../osc.c:600:17: runtime error: index 256 out of bounds for type 'uint32_t [256]' ``` This thrashes the `alpha` member in the terminal struct, causing the windows to turn transparent.
dnkl closed this issue 7 months ago
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.