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
OSC11 query caches response until client is changed #3582
Comments
There is no mechanism for the terminal to tell tmux the colour has changed and polling for the background colour would be silly. If you change the background colour outside tmux you need to detach and reattach. |
Isn't a41a927 simply relaying the OSC11 |
Good point, but no, it doesn't, it reads the default value on attach and uses that if you haven't set a background inside tmux. |
Then it explains the behavior indeed. |
I would accept a PR but I don't know how easy it would be, it might be fiddly to do (there isn't a way for it to wait for a reply before sending the response). |
Zellij queries for the bg/fg colour on every Maybe this could help here, but it looks like not many terminals send Edit: On second thought, |
Try this please which will do it on WINCH but at most once every 30 seconds: tmux-fgbg-winch.diff.txt |
@nicm I can confirm the patch is working. Tested with starting vim inside tmux (which sets The only problem with this implementation is that tmux may miss a colorscheme change, if the user resizes the window and then changes the colorscheme within the next 30 seconds. But still, it's better than nothing. |
Great, I have applied this to OpenBSD now, it will be in GitHub later. Thanks! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue description
Following commit a41a927, the OSC 11 sequence correctly returns the background color, but doesn't reflect any change in background color until client is detached/attached
How to reproduce:
~/osc11.bash
tmux kill-server
tmux new
bash ~/osc11.bash
=>rgb:fbfb/f1f1/c8c8
bash ~/osc11.bash
=>rgb:fbfb/f1f1/c8c8
Still shows the previous background colorC-b d
tmux attach
bash ~/osc11.bash
=>rgb:2020/2020/2020
Shows the new background colorRequired information
tmux next-3.4
@ 0eb5d25Darwin arm
xterm-256color
xterm-256color
The text was updated successfully, but these errors were encountered: