Colors filter is buggy
agavrilov76 opened this issue · comments
Alexey Gavrilov commented
The removeColors filter does remove color for the following input:
�[01;31m�[KAAA�[m�[K=BBB
It returns:
�[K=BBB
It is reproducible when getting the output of the following command: env | grep A
Alexey Gavrilov commented
The fix is to use better regexp to remove the colors:
\x1b[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]
Link: http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed