Closed Erik-Koning closed 2 years ago
No, zsh-syntax-highlighting only handles the zsh command line. Command output does not pass through zsh at all. I'd recommend seeing if your terminal emulator has such a feature.
For your specific use-case, just pipe to egrep --color '^|error'
. You might need to add stdbuf(1) on the LHS of the pipe. For the general case, expect(1) might be a good place to start. Feel free to ask further on zsh-users@.
It would be incredibly helpful to have the regex selection of a text output in terminal be able to be highlighted.
In the case of an output log steam, having any 'error' or 'warning' keywords highlighted would be helpful. Exmaple regex for finding 'error' in a commands output: 'error.*?([;\n$])'
Is this possible to achieve utilizing the code from this repo? How can we achieve this?