Skip to content

Instantly share code, notes, and snippets.

@andreoss
Created April 18, 2021 23:01
Show Gist options
  • Save andreoss/7aa12fd1f773c3d03b36f4ef7fde31dc to your computer and use it in GitHub Desktop.
Save andreoss/7aa12fd1f773c3d03b36f4ef7fde31dc to your computer and use it in GitHub Desktop.
Decolorize output
#!/usr/bin/env --split-string=perl -p
s/ \x1B [ @ A-Z \\ \] ^_ ] //gx;
s/ \x1B \[ [0-9 : ; < = > ? ]{1,8} \W? [@ A-Za-z ^_\` {|} ~]? //gx;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment