wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

force_reverse_video_cursor is not applied when set on window:get_config_overrides

Open alienman5k opened this issue 2 years ago • 4 comments

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

  1. Create an event to change color schemes.
  2. Add a keybinding to emit the event.
  3. 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

alienman5k avatar Aug 11 '23 14:08 alienman5k

Please try the latest release

wez avatar Feb 04 '24 00:02 wez

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.

github-actions[bot] avatar Feb 18 '24 01:02 github-actions[bot]

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.

alienman5k avatar Feb 18 '24 19:02 alienman5k

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.

AmmarAbouZor avatar May 10 '24 05:05 AmmarAbouZor