tmux-thumbs icon indicating copy to clipboard operation
tmux-thumbs copied to clipboard

Buffer colors are not respected

Open nkh opened this issue 5 years ago • 12 comments

tmux-thumb highlights the "hits" it finds in green regardless of the colors of the text.

when the buffer contains colored text, to show different types of data, recoloring everything green loses the original highlighting and makes finding what part to copy difficult.

using green when the string has no color is OK but colored text should be highlighted differently (underlining like terminals do seems like a good way)

nkh avatar Sep 16 '20 08:09 nkh

In addition to having an option to respect the colors, it should be possible to provide arbitrary colors and not just have a list of preselected ones. This plugin is great and all but does not really fit in to the theme I am using (in addition to the above mentioned issue).

TutenStain avatar Nov 30 '20 20:11 TutenStain

@nkh, You need somehow to differentiate the original console text from the tmux-thumbs mode. How do you do it if the colors are almost exactly de same with the only difference of the hints? Removing the original colors helps to reduce the overhead of understanding what is a hint and what isn't. Did you play with the color settings tmux-thumbs provide?

@TutenStain, About being able to set arbitrare colors, we are really limited by color support of terminals. Which one are you using?

fcsonline avatar Dec 01 '20 08:12 fcsonline

I use iTerm and have defined a custom theme for tmux by modifying tmux.conf.

I do not think that only allowing a small set of predefined colors is the way to go, as that would limit the customizability (as for me this plugin sticks out a bit too much given the lack of colors to chose from). What about allowing the standard 256 terminal colors as a start? That would be nice and would suite me well. Bonus if it would be possible to use tmux variables also for referencing colors.

TutenStain avatar Dec 01 '20 15:12 TutenStain

@TutenStain feel free to open a pull request with the 256 colors addition, if you think it can improve your workflow

fcsonline avatar Dec 01 '20 16:12 fcsonline

Should we close this issue?

fcsonline avatar Dec 31 '20 18:12 fcsonline

The original issue is to my knowledge not solved (since tmux-thumbs overrides the terminal colors upon its invocation). Would be interesting to investigate if that can be fixed. However, my comment about arbitrary color configuration support is fixed with a recent PR.

TutenStain avatar Jan 02 '21 15:01 TutenStain

Simplest is to let the user decide what colors should be used to highlight, in my case anything with a different background and foreground color, that I'd like to chose, would work.

nkh avatar Mar 16 '21 10:03 nkh

hi @fcsonline ,

I'm afraid I can't help since I have zero programming knowledge about Rust (it's on my list someday when I retire ;) ) but maybe we can ball a bit about it. Sometimes it's not having someone to talk to about a problem that stops one from finding a solution.

nkh avatar Mar 17 '21 08:03 nkh

Hm I really want to play around with this, perhaps swapping background + foreground for highlighted words, or trying some more intelligent color swapping to ensure high constrast. The change of colors (along with the line shifting bug I just posted) make it take sometimes a couple seconds to find the line I had in my sight. Any hints on which functions / files I could play with to make this happen?

aprowe avatar Nov 04 '21 19:11 aprowe

In the /samples folder, there are many files to play with. They have many cases like long lines, long UTF chars, terminal colors and quite common weird cases. If you found a new interesting test case, feel free to add it.

fcsonline avatar Nov 04 '21 19:11 fcsonline

I spend some time discussing this issue with my daughter, who's very artistic and studies UX, and we looked at many different cases, IE: when the output is in reverse color matching tmux selection color one can't see the start of the selection. There's no universal solution when lots of colors are displayed, maybe blinking and underlining exist for something but I'm not sure having a Christmas tree on the screen helps.

Some color manipulation, as ideas, can be found here https://pinetools.com/complementary-color

on terminals with 256 or more colors, uninteresting text could be dimmed down or desaturated.

Of course letting the user choose is maybe not a bad idea, specially if the choices also contain the possibility to remove colors or not; and is probably the simplest. I'll check the patched version.

nkh avatar Nov 05 '21 09:11 nkh

The main goal is to have high contrast to identify visually the hint as fast as possible. Then, we also have the command arguments to customized how they are shown. If you want to add an option to let users to keep colors or not, feel free.

fcsonline avatar Nov 05 '21 21:11 fcsonline