diff --git a/gen/repl.c b/gen/repl.c index bba817d..5024e94 100644 Binary files a/gen/repl.c and b/gen/repl.c differ diff --git a/repl.js b/repl.js index 091ec23..78f354e 100644 --- a/repl.js +++ b/repl.js @@ -1577,7 +1577,9 @@ import * as bjson from "bjson"; } function print_eval_error(error) { - std.puts(colors[styles.error]); + if (show_colors) { + std.puts(colors[styles.error]); + } if (error instanceof Error) { std.puts(error); std.puts('\n'); @@ -1589,7 +1591,10 @@ import * as bjson from "bjson"; std.puts(error); std.puts('\n'); } - std.puts(colors.none); + + if (show_colors) { + std.puts(colors.none); + } handle_cmd_end(); } @@ -1873,6 +1878,10 @@ import * as bjson from "bjson"; styles = themes.light; } } + s = std.getenv("NO_COLOR"); // https://no-color.org/ + if (s && +s[0] !== 0) { + show_colors = false; + } } load_config();