Skip to main content
NVinc.1
Associate
October 2, 2023
Question

suppress color from STM32_Programmer_CLI

  • October 2, 2023
  • 1 reply
  • 907 views

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.

This topic has been closed for replies.

1 reply

TDK
Super User
October 2, 2023

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""."