Characters represented with ^
followed by another character (an uppercase letter or one of @[\]^_?
), with both characters in a different color (depending on the color scheme), are control characters. ^[
is the escape character. You can get more information by pressing C-x =
(what-cursor-position
) while the cursor is on the character and even more information with C-u C-x =
.
Here, in output meant for a terminal, the escape character starts an escape sequence, specifically an ANSI escape sequence which is how the application tells the terminal to do something other than “display this character at the cursor location and move one position to the right”. Specifically, ^[[…m
(also known as “CSI … m” because the two-character sequence ^[[
is known as CSI) change the text attributes for subsequet output. ^[[1m
turns bold on, ^[[4m
turns underline on, and ^[[0m
turns all attributes off.
Changing those characters to tabs makes no sense whatsoever.
You can use this script to remove most terminal escape sequences.