StringManipulations.jl has a remove_decorations function that can remove ANSI escape sequences from a string.
julia> str = "Test 😅 \e[38;5;231;48;5;243mTest 😅 \e[38;5;201;48;5;243mTest\e[0m";
julia> remove_decorations(str)
"Test 😅 Test 😅 Test"
ANSIColoredPrinters.jl also has a PlainTextPrinter that removes ANSI escape codes, though slightly less convenient to use.
StringManipulations accepts a normal string and returns a string, so it just requires println(msg)
to become println(remove_decorations(msg))
.