-
-
Notifications
You must be signed in to change notification settings - Fork 441
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
Stopgap solution to preserve colors and attributes on highlighting #1542
base: main
Are you sure you want to change the base?
Conversation
I converted this PR to a draft right now, as there are several issues I see with this current implementation.
Regarding highlighting there are basically 5 options right now:
On your question with A_BOLD without color: AFAIR there's no place that uses this and if it is used, the most likely place to look would be with the (text-styled) meters. |
Thanks, threw that check out.
Edits are enabled, I assumed that whoever pulls it squashes it into a single commit.
Fixed all but one, help welcome. It was pain to actually find the issues in the walls of text.
I know, though I do not intend it to look perfect, just good enough for normal use until proper colors are implemented. If the suggested variant is not acceptable, some others would be: A) A_STANDOUT + retain A_BOLD for all colored text: B) A_STANDOUT + retain A_BOLD for all A_BOLD text: C) Just don't touch BOLD text: D) Just don't touch color text: My main goal here is to retain the yellow/red highlighting as I rely on it often and when I filter out instead of search for the process I wish to know is misbehaving because of outdated libs/binary, I get no info about it, this helps: |
NP.
Usually we aim to touch the PRs as little as possible. The PR itself should already tell the changes; the story how you got there is of little interest. Have a look at the style guide for some details. Also, with your code, please mind the indentation: We don't do hanging indentations, but instead do either not break (reasonably long lines allowed) or indent exactly one more level. In the two implementations for
Will take a look …
Will take a look …
The black background for places where colors were preserved visually makes this kinda noisy. So, for most of the columns (e.g. sizes) mapping the color to e.g. bold would usually already suffice and would be much less distracting. Yes, that's not very helpful with your usecase for the outdated binary highlighting while following, but this at least would be a good first step. For the second step, we may extend the color stuff in a way to allow for the (internal) attributes mapped to the theme colors contextually (e.g. specify bold black with red background for a removed process with outdated executable, but bright red with orange background if you followed the same process. But this will likely need some updates to the theme data and thus should be postponed for a bit. |
The remaining error on OpenBSD is this one:
Issue seems to be, that |
This tries to keep special markup like large numbers and other special markup inside a process row even when such a line has been highlighted by being selected, followed, or otherwise marked in the list view. Alternate take on PR htop-dev#434.
Bolding things will have terrible contrast in some cases, which was done and was refused in the last PR.
I'll ifdef it somehow if it will even be kept in the end, and just not have it on OpenBSD I suppose. Here is my least intrusive idea so far - just A_STANDOUT everything that's not colored: Screencast_20240929_234724.webmNone of this really looks great overall, but it's not terrible either. As a side note, I am really digging how this soft-highlight looks like compared to the full-on background highlight in current htop. EDIT: Took the time, it can now be solved properly, but it needs design changes. |
Old demo with wrong column highlights
Screencast_20240929_172318.webm
Screencast_20240929_181531.webm
This is a decent workaround for #243 solely by using text attributes by taking the idea in #434 and expanding it.
This is a stopgap solution until the issue is properly resolved by actually being able to define the desired text colors while keeping the highlight background, which I assume will take a while.
This does not have the same problem as #434 as we are not changing text color by bolding it, we are primarily relying on the terminal to do its highlighting by means of
A_STANDOUT
.This works for any highlight color.
There is a couple problems:
RichString_setAttrn_preserveBold
->RichString_setAttrn_preserve
||RichString_setAttrn_preserve_with_standout
?Settled on
_preserveWithStandout
for nowA_STANDOUT
well from what I understand.Mildly related to #1541