Skip to content
Discussion options

You must be logged in to vote

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 sees submodule "vim as 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 always from your alias and let bat decide, for example alias cat='bat --style auto'. bat's default color mode is auto, which keeps colors when it prints to your terminal but strips them when the output is piped, so your G alias keeps working and you still get colorized output when you…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@flohw
Comment options

Answer selected by flohw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants