You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying for the foreground or background color using the corresponding OSC sequences, zellij always answers with black.
For instance, when I send OSC 11 ; ? ST (query background) I receive back OSC 11 ; rgb:0000/0000/0000 ST even though I'm in a light terminal. Similarly in a dark terminal OSC 10 ; ? ST (query foreground) is responded to with OSC 10 ; rgb:0000/0000/0000 ST.
I noticed that when I clean the cache directory (~/.cache/zellij) I get correct results for the first run of zellij.
Originally this issue was reported in delta (dandavison/delta#1663). Reporting this here totally fell off my radar (sorry).
Reacted by Jacek Modrakowski, Paul Alexander, iofq, Christoph Schmatzler, Claudio Yanes, Bartosz Zbytniewski, Logan Walls, Oleksandr Oksenenko, Ehab Ibrahim, Duy P and 6 more
Similar behaviour here. I'm using Omakub and when I've been switching themes, the NeoVim has had background=light set for some dark themes. I've checked the OSC11 response and it seems that it was wrong. After clearing the cache, all started working properly :)
I did some digging on this and found the root cause.
TL;DR: Zellij caches the OSC 10/11 response and never invalidates it.
When Zellij starts, it queries the terminal for fg/bg colors and saves the response to ~/.cache/zellij/. On subsequent sessions, it returns the cached values instead of asking the terminal again.
The problem is this cache persists even when:
You switch between dark/light themes
You open Zellij in a different terminal
The terminal's color scheme changes
So if Zellij cached colors from a dark theme session, then you switch to light mode, apps still get the old dark theme colors. Worse: if the initial query fails or times out, Zellij caches rgb:0000/0000/0000 (black) for both fg AND bg.
This breaks any app that uses termenv/lipgloss to detect background color — which includes glow, mods, gh, delta, neovim, and pretty much all charmbracelet TUIs. They query OSC 11, get stale/wrong colors from Zellij's cache,
and render text with wrong contrast.
Workaround:rm -rf ~/.cache/zellij/* and restart Zellij. Works until the cache goes stale again.
This is especially painful if you switch between dark/light modes regularly.
Reacted by Tau Gärtli, Reed, Ehab Ibrahim, Teppei Taguchi, Ilkka Poutanen, Oliver Kurz, Yepeng Fan and tummetott
On Thu, Mar 19, 2026, 5:55 AM tummetott ***@***.***> wrote:
*tummetott* left a comment (zellij-org/zellij#3590)
<#3590 (comment)>
Have you tried pulling head and testing? I pushed a PR that adds full
background color support, it should report the right values now.
i did pull the latest main (fc0599a
<fc0599a>)
and build from source:
cargo xtask run
version is:
❯ ./target/dev-opt/zellij --version
zellij 0.44.0
I did delete the old cache (just in case):
rm -rf $HOME/Library/Caches/org.Zellij-Contributors.Zellij/
Now i query OSC11
❯ printf '\e]11;?\e\\' && cat -v
^[]11;rgb:2d2d/2d2d/2d2d^[\
This matches my wezterm bg color:
[colors]background = "#2d2d2d"# ... truncated
next, i change my color scheme in wezterm
[colors]background = "#eaeef2"# ... truncated
Visually, the terminal is now light instead of dark, however OSC11 still
shows:
❯ printf '\e]11;?\e\\' && cat -v
^[]11;rgb:2d2d/2d2d/2d2d^[\
When i now delete the cache again, then it shows the correct value:
❯ printf '\e]11;?\e\\' && cat -v
^[]11;rgb:eaea/eeee/f2f2^[\
So it seems like that your PR @karlbunch <https://github.com/karlbunch>
does not fix this issue. Or am i doing something wrong?
—
Reply to this email directly, view it on GitHub
<#3590 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B74OBZTTQULLDXPDRZXNXFT4RO7ZTAVCNFSM6AAAAACQUCZ6GOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DAOBYHE4TGMRXGA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
@karlbunch i downloaded the latest release 0.44 and i still have the same behavior: OSC11 queries are still reporting incorrect colors. Are you sure this exact scenario was fixed with your PR?
I am having a similar, annoying issue when using helix together with zellij. I think it is the same underlying logic. It came after helix-editor/helix#15527 got merged in helix.
If I change the background of the terminal (alacritty in my case) while a zellij session is on, all the colors change as expected. However, if I start a helix instance and then exit it helix sets the background color to the old one. Even if I exit zellij, kill or delete all sessions the problem persists. The only workaround is to delete the ~/.cache/zellij/0.44.1/stdin_cache.
I don't know what would be the correct logic in this case. I guess zellij keeps reporting the cached background color to helix for some reason, which is strange to me since existing and new sessions have the correct new background color.
Is there a workaround to trigger re-caching of stdin_cache for a running zellij instance?
Activity
jmodrako commentedon Nov 8, 2024
Similar behaviour here. I'm using Omakub and when I've been switching themes, the NeoVim has had background=light set for some dark themes. I've checked the OSC11 response and it seems that it was wrong. After clearing the cache, all started working properly :)
linuxmobile commentedon Jan 4, 2026
I did some digging on this and found the root cause.
TL;DR: Zellij caches the OSC 10/11 response and never invalidates it.
When Zellij starts, it queries the terminal for fg/bg colors and saves the response to
~/.cache/zellij/. On subsequent sessions, it returns the cached values instead of asking the terminal again.The problem is this cache persists even when:
So if Zellij cached colors from a dark theme session, then you switch to light mode, apps still get the old dark theme colors. Worse: if the initial query fails or times out, Zellij caches
rgb:0000/0000/0000(black) for both fg AND bg.This breaks any app that uses
termenv/lipglossto detect background color — which includesglow,mods,gh,delta,neovim, and pretty much all charmbracelet TUIs. They query OSC 11, get stale/wrong colors from Zellij's cache,and render text with wrong contrast.
Workaround:
rm -rf ~/.cache/zellij/*and restart Zellij. Works until the cache goes stale again.This is especially painful if you switch between dark/light modes regularly.
hicder commentedon Feb 26, 2026
for Mac, you'll need to remove this directory
yepengfan commentedon Mar 15, 2026
hi there, any update on this fix?
karlbunch commentedon Mar 15, 2026
Have you tried pulling head and testing? I pushed a PR that adds full background color support, it should report the right values now.
tummetott commentedon Mar 19, 2026
i did pull the latest main (fc0599a) and build from source:
cargo xtask runversion is:
I did delete the old cache (just in case):
Now i query OSC11
This matches my wezterm bg color:
next, i change my color scheme in wezterm
Visually, the terminal is now light instead of dark, however OSC11 still shows:
When i now delete the cache again, then it shows the correct value:
So it seems like that your PR @karlbunch does not fix this issue. Or am i doing something wrong?
calebreed601-dot commentedon Mar 19, 2026
tummetott commentedon Mar 24, 2026
@karlbunch i downloaded the latest release 0.44 and i still have the same behavior: OSC11 queries are still reporting incorrect colors. Are you sure this exact scenario was fixed with your PR?
SametAylak commentedon Apr 4, 2026
I am using broot, and it doesn’t report the correct colors. However, if I exit the zellij session, broot starts using the correct values.
VasilisManol commentedon Apr 21, 2026
I am having a similar, annoying issue when using helix together with zellij. I think it is the same underlying logic. It came after helix-editor/helix#15527 got merged in helix.
If I change the background of the terminal (alacritty in my case) while a zellij session is on, all the colors change as expected. However, if I start a helix instance and then exit it helix sets the background color to the old one. Even if I exit zellij, kill or delete all sessions the problem persists. The only workaround is to delete the ~/.cache/zellij/0.44.1/stdin_cache.
I don't know what would be the correct logic in this case. I guess zellij keeps reporting the cached background color to helix for some reason, which is strange to me since existing and new sessions have the correct new background color.
Is there a workaround to trigger re-caching of stdin_cache for a running zellij instance?
tummetott commentedon Apr 21, 2026
I must delete the cash every time I switch from a dark to a light theme. Very annoying. Would love to see a fix of this issue soon too
oguzhanoya commentedon Apr 29, 2026
That worked for me, thank you @hicder
Ehab-Ibrahim commentedon Apr 30, 2026
I think this should be fixed with #5105. I haven't tried it out myself though.
jonas-srlabs commentedon May 5, 2026
Yes i can confirm this is fixed in the new release. thanks!
imsnif commentedon May 5, 2026
Fixed in 0.44.2
Avoid OSC11/111 within zellij
Fix zellij + kitty startup lag
feat(theme): Ghostty + nvim follow macOS appearance natively