cancel
Showing results for 
Search instead for 
Did you mean: 

suppress color from STM32_Programmer_CLI

NVinc.1
Associate

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.

1 REPLY 1
TDK
Guru

Use sed or awk to remove the color codes prior to processing with a regex.

https://stackoverflow.com/questions/17998978/removing-colors-from-output

 

If you feel a post has answered your question, please click "Accept as Solution".