-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Theme based on terminal colors doesn't work on Tmux #3207
Comments
If you want the colors to change after |
I should have been more precise. I have updated the steps to reproduce the bug. |
What tmux version are you using, and do you have any pane styles set? If I recall correctly, the older versions didn't support background color querying at all, while the newer tmux versions respond directly to the query instead of going through the terminal. |
My Tmux version is 3.5a. My theme is:
where |
I can reproduce this problem as well, on the same bat 0.25.0 (with no configuration), and tmux 3.5a (with oh-my-tmux config) installed with homebrew on macOS 15.3. bat works fine in my terminal (ghostty), but is stuck on the active theme (light or dark) when the tmux session is launched. |
This might be related to this issue. |
I was able to reproduce the behavior, and the upstream tmux issue you mentioned appears to be the underlying cause. Using tmux 3.5a, it will return the original terminal background color when queried, but only until I resize the terminal window. As the linked issue describes, the fix they implemented works by invalidating the cached color when a SIGWINCH signal is sent by the terminal. Unfortunately, it seems that not all of the terminal emulators will do that when the background color is changed, though. Ideally, one of two things would fix this:
Another option would be to make a pull request for terminal-colorsaurus to handle tmux as a special case. If the In the meantime, I can think of a couple of workarounds that can be used until a better solution is implemented:
|
What steps will reproduce the bug?
(I use Catppuccin)
bat file
. The theme should be the correct one.bat file
. The theme should be wrong.What happens?
The theme doesn't switch properly.
What did you expect to happen instead?
The theme should switch when I switch to dark or light mode.
How did you install
bat
?Using the Arch package repository
bat version and environment
Software version
bat 0.25.0 (v0.25.0-modified)
Operating system
Linux 6.12.10-arch1-1
Command-line
Environment variables
System Config file
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
Custom assets metadata
Custom assets
Compile time information
Less version
The text was updated successfully, but these errors were encountered: