Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some windows don't update their colour scheme when system theme changes #3328

Open
gegoune opened this issue Mar 22, 2023 · 13 comments
Open
Labels
bug Something isn't working

Comments

@gegoune
Copy link

gegoune commented Mar 22, 2023

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

20230319-202034-51d7b28f

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

Changing colour scheme in response to change in system wide setting does apply changes to single (current) workspace only.

To Reproduce

  1. Configure Wezterm as per reproducible configuration below or as per example configuration in https://wezfurlong.org/wezterm/config/lua/window/get_appearance.html#windowget_appearance
  2. Open at least one more Workspace
  3. Use MacOS' functionality to switch to different than current (dark/light) mode

Observe colour scheme change for active workspace

  1. Change to another workspace

Observe that new colour scheme didn't get applied here.

Configuration

local wezterm = require 'wezterm'

local colors, _ = wezterm.color.load_scheme(
  (wezterm.home_dir .. '/.local/share/nvim/site/pack/packer/start/zenbones.nvim/extras/wezterm/Zenwritten_%s.toml'):format(
    wezterm.gui.get_appearance():lower()
  )
)

return { colors = colors }

Expected Behavior

All windows/panes/workspaces to receive updated configuration and change their colour scheme accordingly.

Instead only current workspace gets new colour scheme applied.

Logs

No response

Anything else?

Potentially related to #3259

@gegoune gegoune added the bug Something isn't working label Mar 22, 2023
@wez
Copy link
Owner

wez commented Mar 23, 2023

I can't reproduce this. Are there steps missing from your reproduction instructions?

@wez wez added the waiting-on-op Waiting for more information from the original poster label Mar 23, 2023
@wez
Copy link
Owner

wez commented Mar 23, 2023

This is the config I used for testing:

local wezterm = require 'wezterm'

function scheme_for_appearance(appearance)
  if appearance:find 'Dark' then
    return 'Builtin Solarized Dark'
  else
    return 'Builtin Solarized Light'
  end
end

return {
  color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
}

@gegoune
Copy link
Author

gegoune commented Mar 23, 2023

Thank you for looking into it. Surprisingly I cannot replicate it now as well, but just have updated to latest nightly. I wonder if that is because I just restarted Wezterm or there is no issue there no more. I can wait until automatic change at sunset to see if using terminal and having content in windows make any difference.

I will keep issue open for now until I conduct bit more investigation, but since we both can't reproduce it right now I understand if you will close it.

@github-actions github-actions bot removed the waiting-on-op Waiting for more information from the original poster label Mar 23, 2023
@wez wez added the waiting-on-op Waiting for more information from the original poster label Mar 23, 2023
@gegoune
Copy link
Author

gegoune commented Mar 23, 2023

I have managed to trigger the issue. It required few changes between light/dark settings in operating system, switching between workspaces handful of times before colour schemes stopped changing for not current workspace.

I know it's very vague and I am not expecting it would push this issue forward, just wanted to update you and perhaps point towards bit more convoluted reproduction required. I will try to see if I can find concise pattern which results in described issue. Appreciate your patience here, thank you!

@github-actions github-actions bot removed the waiting-on-op Waiting for more information from the original poster label Mar 23, 2023
@gegoune
Copy link
Author

gegoune commented Mar 28, 2023

Hey Wez, I manage to record a video of an issue.

Steps to reproduce:

  • start Western and create another workspace, switch between workspaces once or twice
  • start nvim --clean - not sure if that's required, don't have vim to test it unfortunately, change to other workspace
  • change theme in operating system
  • change workspace and notice how it's colorscheme is not updated.

I have used your configuration from #3328 (comment) to test.
switching

I have added some key mappings to ease with changing workspaces, other than that configuration is as in linked response.
I am not sure why Neovim is somewhat crucial in replicating that issue - this is the most reproducible scenario I managed to come up with, but I am pretty sure it happens even without Neovi involved.

@wez
Copy link
Owner

wez commented Jul 16, 2023

I wonder if this is related to #3685

@gegoune
Copy link
Author

gegoune commented Jul 16, 2023

Is there anything you would like me to do to test it further? I am still seeing that issue.

@wez
Copy link
Owner

wez commented Jul 16, 2023

It might be helpful to capture a session recording of the nvim instance in the affected window.
If it is manipulating the palette then it would be resistant to the overall color scheme changing.

  • Launch wezterm. If possible, please use the default terminal size of 80x24 cells as it helps to keep things smaller and easier to manage.
  • Inside that terminal run wezterm record to start a recording session.
  • Run through your reproduction steps: eg: launch nvim
  • Then type exit
  • You should see a message like:
*** Finished recording to /var/tmp/wezterm-recording-sF6B3u.cast.txt
  • Attach the file that it produced to this issue.

The file is an asciicast (compatible with https://asciinema.org/) and can also be replayed using wezterm replay.

The terminal recording allows me to replicate what is being sent to the terminal without requiring me to install the same applications as you and replicate your configuration for everything.

@wez wez added the waiting-on-op Waiting for more information from the original poster label Jul 16, 2023
@github-actions
Copy link
Contributor

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
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2023
@wez wez reopened this Aug 30, 2023
@wez
Copy link
Owner

wez commented Aug 30, 2023

note to self: recording was sent via email with subject "wezterm recordings for #3328"

Repository owner unlocked this conversation Aug 30, 2023
@wez wez removed the waiting-on-op Waiting for more information from the original poster label Aug 30, 2023
@gegoune
Copy link
Author

gegoune commented Nov 21, 2023

I can actually reproduce it without neovim. All that's needed on top of configuration from #3328 (comment) (with keymaps to switch between workspaces quickly)

local wezterm = require 'wezterm'

function scheme_for_appearance(appearance)
  if appearance:find 'Dark' then
    return 'Builtin Solarized Dark'
  else
    return 'Builtin Solarized Light'
  end
end

return {
  color_scheme = scheme_for_appearance(wezterm.gui.get_appearance()),
  keys = {
    { key = 'l', mods = 'CTRL|CMD', action = wezterm.action.SwitchWorkspaceRelative(1) },
    { key = 'h', mods = 'CTRL|CMD', action = wezterm.action.SwitchWorkspaceRelative(-1) },
  },
}

is

  1. start wezterm
  2. open at least one more workspace
  3. switch between workspaces, toggle system mode (dark, light) few times and change workspaces between toggles - eventually one of the tabs will not get its colorscheme updated.

(Please note that you might have to switch between modes handful of times before issue appears.)

I am on wezterm 20231120-164150-fde92672.

@gegoune gegoune changed the title Workspaces other than active one don't change their colour scheme Some windows don't update their colour scheme when system theme changes Feb 3, 2024
@1orZero
Copy link

1orZero commented Jul 17, 2024

The Issue still persist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants