2023-10-02 01:25 AM
Hello,
I am using STM32_Programmer_CLI extensively from scripts (bash, python, ...) to test firmwares automatically.
One really annoying thing is the fact that the tool persists to output colors even when its stdout is not an interactive tty, this make it annoying to build complex regex to extract informations.
Would it be possible to add a CLI option to suppress colors from stdout/stderr, or even better detect automatically if the output is connected to an interactive session and if not disable the coloration of the output.
Thanks for your support.
Nicolas.
2023-10-02 06:50 AM
Use sed or awk to remove the color codes prior to processing with a regex.
https://stackoverflow.com/questions/17998978/removing-colors-from-output