Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add italics and dim modifier to set_color #3650
I wanted to be able to use
Make sure that the terminfo used contains the appropriate configuration. Here is an example terminfo file:
If these are getting added, can we also add a reverse
In case it's not obvious, this is the same as
Also, the docs should probably mention that italics mode is not available on all terms / it will only work if your term supports it.
I've added reverse as well to set_color as
I think adding a test for Terminal.app in set_color is a good temporary fix. Maybe we can also identify other misconfigured terms and maybe also add a note about updating terminfo?
Hmm, I just wrote a script to go through the capabilities of all the terms in the terminfo database. It looks like the majority of terms have reverse and standout mode set the same, and of those that are different the standout mode is pretty evenly split to being reverse AND bold or reverse AND dim. There are a few where standout mode is just bold (no reverse).
BUT there are a not-insignificant number of terms that don't have a reverse set but DO have a standout mode set. There is only one (that I saw) that has a reverse set but no standout mode.
So a proposed change: if
(Sorry to make a little more work for you @DivineGod)
Here's the script I made to check it out (also shows if terms have an italics or dim capability):
Ok, since I really would like this PR added, here's a patch for you @DivineGod. It patches color.h, highlight.cpp, and output.cpp. It should fix the issue with the highlighter. You should be able to download it and
Note for the devs: I added flags to
Here's the patch:
I'm OK with this now. Maybe @ridiculousfish should look it over, but I'm OK with merging it.
What's still left to be done is figuring out how to make it work for Apple_Terminal, or maybe other terminals out there with missing terminfo defintions, but I'm ok with deferring that to be a later PR.