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

🚀 Add option to override terminal's background color #153

Closed
jc00ke opened this issue Apr 28, 2020 · 6 comments
Closed

🚀 Add option to override terminal's background color #153

jc00ke opened this issue Apr 28, 2020 · 6 comments

Comments

@jc00ke
Copy link

jc00ke commented Apr 28, 2020

image

(yadm just forwards, and I tested it with bare git too)

Am I doing something silly? This is with delta 0.1.1 on Linux with kitty 0.17.3

@jc00ke
Copy link
Author

jc00ke commented Apr 28, 2020

Hmm, even delta --list-themes looks off...
image

@dandavison
Copy link
Owner

dandavison commented Apr 28, 2020

Hi @jc00ke, thanks for opening an issue! It may be that I've done something that doesn't make sense or is surprising people. Currently, delta only alters the background color in added/removed lines. Otherwise, the background color is whatever your terminal emulator is producing. Is it that that's violating your expectations?

@dandavison
Copy link
Owner

the background color is whatever your terminal emulator is producing.

I believe that bat takes the same approach: sharkdp/bat#339 (comment)

Does this make sense? There have also been questions about it in #87. (Wouldn't it be rather visually jarring for delta/bat to produce different background colors from what your terminal is set to?)

@jc00ke
Copy link
Author

jc00ke commented Apr 28, 2020

Ah, that makes sense, and yes, that's violating my expectations 😉
I had the expectation that the background would match the selected theme, that way the highlighted line and colors would adhere to the theme better. I didn't realize bat does that as well, and it makes sense, but it also makes sense to think of it like someone setting a piece of paper on my desk. The paper's color shouldn't match the color of my desk.

As for a jarring experience, yes, totally. I had light set to test the background, but I'll switch to dark since that's my default Solarized variant. For a while I ran vimdiff with the light variant just to really make it clear I was in diffing mode. But I don't personally mind 😜

@dandavison dandavison changed the title 🐛 Themes aren't respected in Kitty 🐛 Delta does not change terminal's background color Apr 28, 2020
@gpressutto5
Copy link

It would be great to have an option to change the background for not changed lines too. This way we could use light themes for diff while still using a dark theme for terminal.

@dandavison dandavison changed the title 🐛 Delta does not change terminal's background color 🚀 Add option to override terminal's background color Apr 29, 2020
@dandavison
Copy link
Owner

@jc00ke @gpressutto5 @natsumi @lightspeedbriefs

The master branch of delta now allows the background color to be set, overriding the terminal. Please see the write-up in #205 for full details!

Here's an example showing how to use a light theme with a dark terminal background, as @gpressutto5 suggested:

delta --theme=OneHalfLight --minus-style 'syntax auto' --minus-emph-style='syntax auto'
      --zero-style 'syntax white'
      --plus-style 'syntax auto' --plus-emph-style 'syntax auto'
      --hunk-header-style='syntax white' --hunk-header-decoration-style='black box'
image

To build delta from source:

You'll need to install the rust tools.

git pull origin master
cargo build --release
./target/release/delta --help

Closing this because I think it's fixed, but as always please re-open if not.

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

3 participants