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

Wrong light colorscheme in zellij #862

Open
apraga opened this issue Apr 2, 2024 · 7 comments
Open

Wrong light colorscheme in zellij #862

apraga opened this issue Apr 2, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@apraga
Copy link

apraga commented Apr 2, 2024

Hi,

Using zellij light theme (tested with solarized-light), broot's own light theme (also solarized) looks bad inside zellij :
broot-zellij

but fine outside zellij
broot

Broot correctly detects it's a light theme though. My conf.hjson :

imports: [
    verbs.hjson

    
    {
        luma: [
            dark
            unknown
        ]
        file: skins/dark-gruvbox.hjson
    }
    {
        luma: light
        file: skins/solarized-light.hjson
    }
]

Terminal: alacritty, with solarized-light here. Any idea would be great, thanks !

@apraga apraga added the bug Something isn't working label Apr 2, 2024
@Canop
Copy link
Owner

Canop commented Apr 2, 2024

Broot correctly detects it's a light theme though

Are you sure ? Can you have a look at the debug log ?

@apraga
Copy link
Author

apraga commented Apr 2, 2024

Interesting. It is detecting the light theme in both case but apply the dark theme ?
In zellij

19:15:25.548 [DEBUG] broot::display::luma: terminal_light::luma() took 421.902µs
19:15:25.548 [INFO] broot::display::luma: terminal's luma: Ok(0.15625)
19:15:25.548 [DEBUG] broot::conf::conf: reading conf file: "/home/alex/.config/broot/skins/dark-gruvbox.hjson"
19:15:25.550 [DEBUG] broot::conf::conf: skipping not applying conf file : "skins/solarized-light.hjson"


Outside zellij

19:14:47.681 [DEBUG] broot::display::luma: terminal_light::luma() took 209.449µs
19:14:47.681 [INFO] broot::display::luma: terminal's luma: Ok(0.96371955)
19:14:47.681 [DEBUG] broot::conf::conf: skipping not applying conf file : "skins/dark-gruvbox.hjson"
19:14:47.681 [DEBUG] broot::conf::conf: reading conf file: "/home/alex/.config/broot/skins/solarized-light.hjson"

I've edited the issue with the full configuration for dark and light theme.

@Canop
Copy link
Owner

Canop commented Apr 2, 2024

In your first log (zellij), the terminal is seen as dark (luma = 0.15625), and the dark theme is applied

@Canop
Copy link
Owner

Canop commented Apr 2, 2024

It's a little weird. There are many reasons to not be able to detect the background color, but there should not be any wrong detection.

If you're always on a light background, an obvious workaround is to just not detect and always apply the light theme.

@apraga
Copy link
Author

apraga commented Apr 2, 2024

Here's a screenshot of the whole zellij windows :

zellij

Maybe the black borders are confusing the luma computation ? I'm switching between dark and light depending on the time of the day :)

Edit could you show how to force a given theme whatever the luma ? Thanks.

@Canop
Copy link
Owner

Canop commented Apr 2, 2024

To force the theme, do

imports: [
    verbs.hjson
    skins/dark-gruvbox.hjson
]

@apraga
Copy link
Author

apraga commented Apr 2, 2024

Further testing: same results in other shells (fish, sh, initially tested with nushell).
I've tested (at least I hope) your strategy in terminal-light using terminal escape code. In zellij

~> printf "\x1b]11;?\x07"
~> ]11;rgb:fbfb/f1f1/c7c7

Outside zellij

 ~/.c/broot> printf "\x1b]11;?\x07"
~/.c/broot> ]11;rgb:2828/2828/2828^C

By the way, feel free to move the issue in terminal-light !

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

2 participants