clarkwang/sexpect

option to discard color codes & al

macmpi opened this issue · 2 comments

Some programs (like bluetoothctl) report messages with color codes that can't be disabled: that makes sexpect regex quite challenging to craft (expect seems immune to that).
Would it make sense to have a mode/option to discard all of such formatting for regex/exact/glob matches?
Thanks for consideration.

It's also very challenging for sexpect. It's not easy to recognize these control sequences.

maybe something like this could help?
https://gitlab.com/saalen/ansifilter/