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

🐛 Always using light theme on dark background #1663

Open
2 tasks done
EbonJaeger opened this issue Mar 21, 2024 · 9 comments
Open
2 tasks done

🐛 Always using light theme on dark background #1663

EbonJaeger opened this issue Mar 21, 2024 · 9 comments

Comments

@EbonJaeger
Copy link

After updating to the 0.17.0 release, I can no longer read git diffs due to delta using a light theme on my dark terminal background.

My setup consists of Alacritty with Zellij and Fish. I tested on a stock GNOME Terminal as well with un-modified bash, and the problem happens there, as well. My .gitconfig options for diffing matches that in the Delta readme.

  • Please include the raw text output from git, so that we can reproduce the problem.
    (You can use git --no-pager to produce the raw text output.)
    diff --git a/packages/a/adw-gtk3-theme/package.yml b/packages/a/adw-gtk3-theme/package.yml
    index aeb8a25200..06017a5c30 100644
    --- a/packages/a/adw-gtk3-theme/package.yml
    +++ b/packages/a/adw-gtk3-theme/package.yml     @@ -1,8 +1,8 @@
     name       : adw-gtk3-theme
    -version    : '5.2'
    -release    : 12
    +version    : '5.3'
    +release    : 13
     source     :
    -    - https://github.com/lassekongo83/adw-gtk3/archive/refs/tags/v5.2.tar.gz : 1265b9dbc933bf602da1c419e515752bc8d7b9e6f8a09eafd740315d321501d7
    +    - https://github.com/lassekongo83/adw-gtk3/releases/download/v5.3/adw-gtk3v5.3.tar.xz : 2e6e87935bef30936e40d07c7af4fd20754e77917be224f61c4346867196bef0
     license    : LGPL-2.1-only
     homepage   : https://github.com/lassekongo83/adw-gtk3
     component  : desktop.them
  • A screenshot of Delta's output is often helpful also.

image

@dandavison
Copy link
Owner

Hi @EbonJaeger, sorry about that. Please add dark = true or --dark to your delta config / invocations to force colors for dark backgrounds.

delta in 0.17.0 should autodetect in the absence of the light/dark setting. I wonder if it could be an issue with Zellij cc @bash -- any thoughts?

@rsmmr
Copy link

rsmmr commented Mar 22, 2024

I'm seeing the same issue but only when I'm inside a tmux shell. Outside tmux it works fine.

@bash
Copy link
Contributor

bash commented Mar 22, 2024

Hi @EbonJaeger 👋 Thank you for reporting the bug!
In your GNOME Terminal setup, are you running Bash inside of Zellij or directly in GNOME Terminal?

I would be surprised if the issue happened in GNOME Terminal directly as it has always correctly reported colors in my experience.

@dandavison From a quick glance and some preliminary tests it does seem like Zellij reports incorrect colors (happens to me both in Alacritty and GNOME Terminal). If will try to dig further next week or so.

@bash
Copy link
Contributor

bash commented Mar 22, 2024

@rsmmr What version of tmux are you running? Color detection should work OK in the latest version from git iirc.

@EbonJaeger
Copy link
Author

@bash I was not using Zellij or tmux in GNOME terminal; just straight Bash. I'll try the workaround later. 😃

@EbonJaeger
Copy link
Author

I tried again with GNOME terminal this morning and it is working as expected. Maybe I didn't start a new session or something last night after trying to force the dark theme. Sorry about that. So that just leaves Zellij.

The workaround of setting dark = true in the .gitconfig works, though! Thanks!

@bash
Copy link
Contributor

bash commented Mar 22, 2024

That's great to hear! I was worried there for a second since GNOME Terminal always worked well in my experience 😆

@lilyball
Copy link

I've hit this too. It works fine in tmux, but not in zellij. What's more annoying is that the new --detect-dark-light flag cannot be set through gitconfig, which means my only option is to force dark on all the time instead of letting it infer from my theme.

@lilyball
Copy link

Also I will note that Zellij sets a few env vars that can be used to detect that we're running in Zellij.

Fryuni added a commit to Fryuni/config-files that referenced this issue Apr 22, 2024
diogotcorreia added a commit to diogotcorreia/dotfiles that referenced this issue Aug 9, 2024
Workaround for Zellij reporting incorrect theme.

See dandavison/delta#1663
lukehsiao added a commit to lukehsiao/dotfiles that referenced this issue Sep 6, 2024
elerch added a commit to elerch/vcsh_gitconfig that referenced this issue Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants