Comment on ANSI Escape CodesparentComments−nitrogen5yIt's also fairly straightforward to strip escape codes if you need to using sed or similar[0], and there probably already exists a tool that will do just that specifically and more robustly than my example.[0] Here's a basic example I wrote in Ruby: https://github.com/mike-bourgeous/mb-util/blob/5616cc4ce6218... str.gsub(/\e\[[^A-Za-z~]*[A-Za-z~]/, '')−rbanffy5yI just select the styling depending on what stdout/stderr are. If output is not going to a terminal, styling strings are empty.
Comments
It's also fairly straightforward to strip escape codes if you need to using sed or similar[0], and there probably already exists a tool that will do just that specifically and more robustly than my example.
[0] Here's a basic example I wrote in Ruby: https://github.com/mike-bourgeous/mb-util/blob/5616cc4ce6218...
I just select the styling depending on what stdout/stderr are. If output is not going to a terminal, styling strings are empty.