Closed junkblocker closed 1 year ago
Please include the configuration that you mention that triggers this when you cycle. Please also include the trace inline in this report, not in pastebin.
Added trace inline.
I have code which changes a single layer background image on keypress. As I cycle through it, it randomly crashes.
Where is the config for this?
Is there a specific animated image you are using for this?
There are no animated images. There are all jpgs or pngs. The configuration is difficult to extact but I'm just overriding the background. The change code looks like this and trigged by a keypress
function change_wallpaper(window, notused)
log("change_wallpaper called") -- log is just just wezterm.log_info
if not wezterm.GLOBAL.ENABLE_WALLPAPER then
log("change_wallpaper called when wallpapers are not enabled")
return
end
-- set a new one
local img, brightness = random_wallpaper() -- returns an image path and a float , usually 0.05
log(img .. " at " .. tostring(brightness) .. " brightness")
wezterm.GLOBAL.WALLPAPER_LAST_FIDDLED_WITH = os.time()
-- set a new one
local overrides = window:get_config_overrides() or {}
overrides.background = {
-- This is the deepest/back-most layer. It will be rendered first
{
source = {
File = img,
},
-- The texture tiles vertically but not horizontally.
-- When we repeat it, mirror it so that it appears "more seamless".
-- An alternative to this is to set `width = "100%"` and have
-- it stretch across the display
repeat_x = 'NoRepeat',
hsb = { brightness = brightness },
-- When the viewport scrolls, move this layer 10% of the number of
-- pixels moved by the main viewport. This makes it appear to be
-- further behind the text.
attachment = "Fixed",
horizontal_align = 'Center',
vertical_align = 'Middle',
horizontal_offset = 0,
vertical_offset = 0,
height = "Cover",
},
}
window:set_config_overrides(overrides)
wezterm.background_child_process({ "wpaper", img }) -- a script that sets desktop wallpaper
wezterm.background_child_process({ "konsole-wpaper", img }) -- a script that copies the image setting over to konsole config
end
The line of code mentioned in your panic is in the middle of handling frames from an animated image source. Note that PNGs can be animated. Can you figure out which of your backgrounds might be the source of this and share it?
Alternatively, are you running something that uses the kitty image protocol to send multiple frames of images?
Ah, I seem to have some WebP images and it is crashing on those. It still looks to be a single frame but even Okular is having trouble opening it. sxiv/nsxiv/qimgv open these ok. Github won't let me attach one here. Even imgur is failing to allow upload of that.
This should be resolved now in main
.
It typically takes about an hour before commits are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.
Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.
If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg
file on macOS, a .zip
file on Windows and an .AppImage
file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.
If you are eager and can build from source then you may be able to try this out more quickly.
Yep, it is fixed. Thanks!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
What Operating System(s) are you seeing this problem on?
FreeBSD Wayland
Which Wayland compositor or X11 Window manager(s) are you using?
No idea. Fedora 38 KDE/Plasma whatever default compositor it has. I am sure I see the crash with X11 too though.
WezTerm version
wezterm 20230423-174840-5c2e3fe8
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
Yes, and I updated the version box above to show the version of the nightly that I tried
Describe the bug
I have code which changes a single layer background image on keypress. As I cycle through it, it randomly crashes.
To Reproduce
Random
Configuration
no config
Expected Behavior
Should not crash.
Logs
Anything else?
No response