My program is outputting text which sometimes contains escape sequences such as “\x1B[J” (Clear screen). Is there anyway to suppress the escape sequence such that it doesn’t perform its associated action but instead gets displayed via its text representation?
I would even be interested in doing this for \n and \r.
Escape the
\characters by changing each occurence to\\.Note that these sequences work only, when you enter them in source code. Check the result of the following program: