Open prioux opened 5 years ago
sample perl script http://impson.tzo.com/~jdimpson/bin/script-declutter to interpret controls. A simple stripping Ruby snippet https://rosettacode.org/wiki/Strip_control_codes_and_extended_characters_from_a_string
With a proper gem, colors can be rendered rather than stripped https://rubygems.org/gems/ansi-to-html/versions/0.0.3, https://buildkite.com/blog/terminal-open-source-ansi-to-html-renderer
Some programs colorize their outputs, so before sending back the stdout and stderr to be displayed in CBRAIN, let's strip those ANSI sequences. Maybe also let's escape or delete any other non-printable control characters, such as as ^H.