Thanks a lot for fd, it's a really neat utility!
I'd like to kindly ask for a small feature addition: Please colorize the matched substring similar to how grep does it. I.e. compare the following two:
fd --color=always something
fd --color=always something | grep --color=always something
Ideally, the colorization of the second command would also be used for the first command.
Thanks
Thank you for the feedback!
Please see #46 and #53
Too bad this was abandoned :'( I'll probably have to make myself a wrapper than that uses grep like above. Feel free to close this then if you don't want to implement this.
Cheers
I'm happy to discuss this again, if there is an interest for this feature.
I don't think the grep wrapper will work as expected because
The grep works for me. I mean sure, it loses the highlighting in parts of the path. But that's not as important to me as actually seeing the matched substring.
If this feature would be built-in to fd, it could close the previous ANSI code, highlight the substring, then reopen the previous ANSI code. I have zero knowledge of your code base, so I can't say how hard this is. Conceptually, I would personally solve it by delaying the highlighting until right before the output is written. I.e. keep a stack of highlighted ranges and then just add ranges there. Once you highlight, you can use that data to output the ANSI colorings as needed and simulate the nesting.
That's essentially what the prototype in #53 does.
Then I hope you re-evaluate your decision to abandon that change ;-)
+1
I don't see any strong support for this, so I'm going to close this for now (sorry).
Nooooo枚ooooo!
Most helpful comment
Then I hope you re-evaluate your decision to abandon that change ;-)