Repository navigation
How to grep output ? #4089
|
Hi, I have configured an alias The current workaround is to use I think the problem comes from sequence (or command, I don't remember how they're called) character to add syntactic coloration. Is there a way to grep on colorized bat output ? Thank you |
Replies: 1 comment 1 reply
|
you are right that the color sequences are the cause. i reproduced this locally: with the cleanest fix is to drop for a one-off without touching the alias, |
you are right that the color sequences are the cause. i reproduced this locally: with
bat --color always, the output has escape codes inserted between every token, so grep never seessubmodule "vimas one contiguous string. your pattern only fails because it spans the space between two differently colored tokens, which is why single-word patterns still worked fine for you.the cleanest fix is to drop
--color alwaysfrom your alias and let bat decide, for examplealias cat='bat --style auto'. bat's default color mode isauto, which keeps colors when it prints to your terminal but strips them when the output is piped, so yourGalias keeps working and you still get colorized output when you…