-
Notifications
You must be signed in to change notification settings - Fork 335
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
How to remove color for the common portions of lines that differ? --> Light vs Dark Mode challenges on macOS #464
Comments
I suspect you want to change these config lines:
You have to set them to whatever "normal" text color you use. If you set it to |
This is definitely going in the direction I seek, thanks @scottchiefbaker. An initial problem (not sure if it's the only one, I've been testing for only 5 mins): "Light-vs-Dark Mode" (at least on my macOS v12.6.3 system). The foreground font color inverts in each mode, and setting "white" or "black" or some other "normal", "default", or "foreground" (and I've attempted all these aforementioned values in the quotes) foreground-text dolor . The red/green font works well in both Light and Dark Modes (and I'm sure this is not a d-s-f coincidence). |
Because if you use named colours then they'll follow the theme, if you used colour codes instead then of course you just get that colour, so would probably only be what you want in whichever mode you were in when you configured it. |
Hi @OJFord - are you suggesting that there's no way to auto-adjust for Dark-vs-Light Mode/themes? Or... are you suggesting some "codes" do exist that will auto-adjust?
|
No no, that what you have with named colours like |
Okay. My interpretation: named colors (like Regardless, the following is doing what I want for this issue... at least it is now. Last night it was NOT working, for some reason. (Maybe it's because I restarted iTerm2.app since then? Hard to say/know.)
Now, [Closing this issue] |
[Reopen-ing this issue] Setting "black" foreground does not work for Dark Mode in macOS v12.6.3 (my system). In lieu of a better answer, I'll need to change my git config (swapping between
I was previously mistaken about an earlier fix solving this (without |
What do you mean by 'not working'? What actually happens/errors? The highlighting is actually delegated to diff-highlight, and so bugs about that are unlikely to be dsf bugs. Further, it's hard to say without knowing what isn't working exactly, but it's unlikely I think even to be a diff-highlight bug - if the colour is changing but just not what you want, then that's an issue with your configuration or terminal. |
You could try "normal" for both |
@johnnyutahh what is the status on this issue? |
@scottchiefbaker - apologies I did not reply sooner. Does the following provide everything needed for this issue? I was not able to get So I run a Details on the above commands/settings/config_files here: https://gist.github.com/johnnyutahh/d6310eb416e846601ba4e86a9abd164e |
Additionally: if macOS light-vs-dark-mode handling is something that diff-so-fancy will specifically not support, than a pointer to this issue (or similar content) in the docs might (?) be helpful for future users. However, I can only speculate, I do not track full project context for this color/formatting-output stuff. |
It's not really a case of diff-so-fancy not (or declining to) supporting it - it's just outside its concern. The colours resulting from using dsf (as with plain git, or git with diff-highlight) are just codes for your terminal to render. It's the terminal which is (in some cases) the macOS application, and so the terminal which can interpret background/foreground/specificl colouring according to the OS's preferences. Put another way, if you tell dsf 'print removed lines in red' in your config, then dsf tells your shell 'print this line in red' and your shell tells your terminal 'start printing in red' and your terminal looks up what colour 'red' is. If 'red' is different in light vs dark mode, that's the terminal's concern. |
Thanks @OJFord, quite helpful. More comments:
Right. Finding a way to configure "mapping/render" settings for iTerm2's light-dark-mode automatic changes, if it's a good/useful/"best" way to solve the problem I've highlighted at the end of this issue, would be quite useful for me. Suggestions welcome for said iTerm2-configuration, or any other "configurable" path. ...if I'm understanding things correctly. However, I can appreciate this is or may be well outside of the scope of dsf. Regardless: dsf provides me tremendous value -- thank you diff-so-fancy team! |
Is there a way to remove color for the common portions of lines that differ... and only highlight the ports that differ (which d-s-f does so nicely with the red-backgrounded and green-backgrounded text)?
Disclaimers:
I highly suspect this is a FAQ or some existing config setting... but I could not find a reference anywhere. Maybe there's something there that I just don't understand. Apologies if I did not RTFM properly.
Also: I did not sea a
Discussion
section of this repo, else I would have made a newDiscussion
vs posting thisIssue
.The text was updated successfully, but these errors were encountered: