From f784f27a55a925f8699edf1dcf875f0af2e6833e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 4 Mar 2026 22:06:01 +0100 Subject: colorized string : use \e instead of \033 --- lib/colonial_twilight/colorized_string.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/colonial_twilight/colorized_string.rb b/lib/colonial_twilight/colorized_string.rb index 65f2623..b2b8421 100644 --- a/lib/colonial_twilight/colorized_string.rb +++ b/lib/colonial_twilight/colorized_string.rb @@ -3,9 +3,9 @@ # this adds ascii colorization to String class class String - RESET = "\033[0m" - CLEAR_LINE = "\33[2K\r" - CLS = "\033[0;0f\033\[2J" + RESET = "\e[0m" + CLEAR_LINE = "\e[2K\r" + CLS = "\e[0;0f\e\[2J" @color_codes = { black: 0, light_black: 60, @@ -61,10 +61,10 @@ class String private - START_CODE = /^\033\[([0-9;]+)m/.freeze + START_CODE = /^\e\[([0-9;]+)m/.freeze # negative lookbehind : (? is not at the start of the line # negative lookahead : (?! ) + $ => is not at the end of the line - MIDDLE_RESET = /(?