force_reverse_video_cursor is not applied when set on window:get_config_overrides
What Operating System(s) are you seeing this problem on?
macOS
Which Wayland compositor or X11 Window manager(s) are you using?
No response
WezTerm version
20230712-072601-f4abf8fd
Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?
No, and I'll explain why below
Describe the bug
I am trying to toggle color schemes on the fly (by pressing a keybinding) I have a fixed set of color schemes to toggle and that works fine, but once the color scheme is updated so it does the cursor color. I use force_reverse_video_cursor but setting that value to true on the config overrides does not seem to apply properly.
To Reproduce
- Create an event to change color schemes.
- Add a keybinding to emit the event.
- Press the keybinding (color scheme is changed but the cursor no longer respects the force_reverse_video_cursor property until it goes back to the first color scheme)
Configuration
local wezterm = require 'wezterm'
local config = {}
local defaults = {
maximized = false,
opacity = 0.92,
blur = 15,
color_schemes = {
'Catppuccin Mocha',
'Japanesque',
'Classic Dark (base16)',
'Solarized Dark Higher Contrast',
'GruvboxDark',
'Tomorrow Night',
'terafox',
'Banana Blueberry',
'OneHalfDark',
'Ubuntu'
},
current_color_index = 1
}
config.color_scheme = defaults.color_schemes[defaults.current_color_index]
config.default_cursor_style = "SteadyBlock"
config.force_reverse_video_cursor = true
wezterm.on('change-colorscheme', function (window, _)
if defaults.current_color_index < #defaults.color_schemes then
defaults.current_color_index = defaults.current_color_index + 1
else
defaults.current_color_index = 1
end
-- config.color_scheme = color_schemes[current_color_index]
local overrides = window:get_config_overrides() or {}
overrides.color_scheme = defaults.color_schemes[defaults.current_color_index]
overrides.force_reverse_video_cursor = true
wezterm.log_info(overrides)
window:set_config_overrides(overrides)
window:toast_notification('Color Scheme changed', defaults.color_schemes[defaults.current_color_index], nil, 5000)
end)
config.keys = {
{
key = 't',
mods = 'SUPER|CTRL',
action = wezterm.action.EmitEvent('change-colorscheme')
},
}
return config
Expected Behavior
Apply force_reverse_video_cursor to any color scheme that is changed after wezterm was loaded.
Logs
No response
Anything else?
No response
Please try the latest release
This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.
I tried the latest release "20240203-110809-5046fc22" but I still see the issue. The setting is ignored upon changing a color_scheme on a running instance.
I'm having the same issue on Linux with the latest release "20240203-110809-5046fc22" too. I've tried to set the value to false -> apply, and again to true -> apply but id didn't work either. It works again only if I toggle and use the original color scheme again.