From 6e37f705333ec9d6449053fae45d09f05b0aebb9 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Mon, 5 Aug 2024 21:14:19 -0700 Subject: [PATCH] Sanitize ansi codes rate than throwing by default (#344) Generally better to leave weird codes in the output than to crash --- .mill-version | 2 +- utest/src/utest/ufansi/Fansi.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mill-version b/.mill-version index 26696041..1a775473 100644 --- a/.mill-version +++ b/.mill-version @@ -1 +1 @@ -0.11.7-29-f2e220 \ No newline at end of file +0.11.11 diff --git a/utest/src/utest/ufansi/Fansi.scala b/utest/src/utest/ufansi/Fansi.scala index 20df8bb5..88c5ed01 100644 --- a/utest/src/utest/ufansi/Fansi.scala +++ b/utest/src/utest/ufansi/Fansi.scala @@ -277,7 +277,7 @@ object Str{ * input `CharSequence` contains an Ansi escape not * recognized by Fansi as a valid color. */ - def apply(raw: CharSequence, errorMode: ErrorMode = ErrorMode.Throw): ufansi.Str = { + def apply(raw: CharSequence, errorMode: ErrorMode = ErrorMode.Sanitize): ufansi.Str = { // Pre-allocate some arrays for us to fill up. They will probably be // too big if the input has any ansi codes at all but that's ok, we'll // trim them later.