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

Improve clarity of inline diff style #613

Open
wez opened this issue Dec 31, 2023 · 1 comment
Open

Improve clarity of inline diff style #613

wez opened this issue Dec 31, 2023 · 1 comment

Comments

@wez
Copy link

wez commented Dec 31, 2023

First, thanks for building this tool!
I fully appreciate that colored terminal output is hard, just sharing an example that affects me.
I find it difficult to use 2-column diff output in the terminal; 80 cols is not wide enough for it,
and 160+ cols is too wide to be readable (too much horizontal distance to scan, making it hard work to read), so I use the inline diff style.

Here's how it renders in my terminal with syntax highlighting enabled:

image

My terminal is set to display regular bold text as tomato red, which is something I picked up in the 90's with xterm and have carried with me since then. In this case, the bold colors from the syntax highlighting show unchanged text in red which is undesirable because it suggests that that text was removed/changed.

It's pretty hard to visually parse the above.

Here's how it looks with syntax highlighting disabled:

image

the content is less distracting, but it is still difficult to intuit at a glance which parts of the output are the filename and, more importantly, it looks like the changed lines are actually doubled up because the distinguishing part of the line is just the changed colors all the way over on the left.

Here's how my vanilla git diff renders; I find this much more readable at-a-glance even though it is more work to parse out specifically what in the line changed:

image

I personally find the use of bold+green in the difftastic output to be super bright and uncomfortable to read with a full screen of additions. You can see from the screen shots above that the regular git output is not such a bright green. I would love to have some control over this, as this sort of thing is very subjective.

I've seen this old, lingering PR:

which could help a lot with this, conceptually, but I think that also having some control over the color choices would go a long way to making the output a bit more accessible. It doesn't need to be a full-blown styling engine but it should provide some control to the user.

Thanks again!

@joyously
Copy link

Although I think having color options is a good thing, it's odd that you would use the terminal options to abuse the definition of bold as a color instead of a brightness, and then want each tool you use to support color options to accommodate that general choice.

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

2 participants