diff options
author | Robin Jarry <robin@jarry.cc> | 2022-07-12 21:13:24 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-07-18 13:58:21 +0200 |
commit | 3ef4a3ca051a0d445b300d13fa86bc31b3c8c9e0 (patch) | |
tree | 6369bf32d2831aa6265de28ecaa734bf04b9bfc8 | |
parent | f642fc90385ad521d32415b1fb5449becbe1a566 (diff) | |
download | aerc-3ef4a3ca051a0d445b300d13fa86bc31b3c8c9e0.zip |
filters: try and make awk scripts posix compliant
\x escape sequences are GNU specific. Use the octal escape code instead.
filters/calendar is beyond help. It would need a complete rewrite to
make it work with POSIX awk.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
-rwxr-xr-x | filters/colorize | 26 | ||||
-rwxr-xr-x | filters/plaintext | 6 |
2 files changed, 16 insertions, 16 deletions
diff --git a/filters/colorize b/filters/colorize index 5fad883..322caa4 100755 --- a/filters/colorize +++ b/filters/colorize @@ -3,19 +3,19 @@ BEGIN { # R;G;B colors - url = "\x1b[38;2;255;255;175m" # yellow - header = "\x1b[38;2;175;135;255m" # purple - signature = "\x1b[38;2;175;135;255m" # purple - diff_meta = "\x1b[1;38;2;255;255;255m" # bold white - diff_chunk = "\x1b[38;205;0;205m" # cyan - diff_add = "\x1b[38;2;0;205;0m" # green - diff_del = "\x1b[38;2;205;0;0m" # red - quote_1 = "\x1b[38;2;95;175;255m" # blue - quote_2 = "\x1b[38;2;255;135;0m" # orange - quote_3 = "\x1b[38;2;175;135;255m" # purple - quote_4 = "\x1b[38;2;255;95;215m" # pink - quote_x = "\x1b[38;2;128;128;128m" # gray - reset = "\x1b[0m" + url = "\033[38;2;255;255;175m" # yellow + header = "\033[38;2;175;135;255m" # purple + signature = "\033[38;2;175;135;255m" # purple + diff_meta = "\033[1;38;2;255;255;255m" # bold white + diff_chunk = "\033[38;205;0;205m" # cyan + diff_add = "\033[38;2;0;205;0m" # green + diff_del = "\033[38;2;205;0;0m" # red + quote_1 = "\033[38;2;95;175;255m" # blue + quote_2 = "\033[38;2;255;135;0m" # orange + quote_3 = "\033[38;2;175;135;255m" # purple + quote_4 = "\033[38;2;255;95;215m" # pink + quote_x = "\033[38;2;128;128;128m" # gray + reset = "\033[0m" # state in_diff = 0 in_signature = 0 diff --git a/filters/plaintext b/filters/plaintext index 922ae7c..aa22eb7 100755 --- a/filters/plaintext +++ b/filters/plaintext @@ -1,9 +1,9 @@ #!/usr/bin/awk -f BEGIN { - dim = "\x1B[2m" - cyan = "\x1B[36m" - reset = "\x1B[0m" + dim = "\033[2m" + cyan = "\033[36m" + reset = "\033[0m" } { # Strip carriage returns from line |