Why are special characters such as "carriage return" represented as "^M"?

Posted by dotancohen on Super User See other posts from Super User or by dotancohen
Published on 2014-06-05T08:31:31Z Indexed on 2014/06/11 9:29 UTC
Read the original article Hit count: 166

Why is ^M used to represent a carriage return in VIM and other contexts?

My guess is that M is the 13th letter of the Latin alphabet and a carriage return is \x0D or decimal 13. Is this the reason? Is this representation documented anywhere?

I notice that Tab is represented by ^I, which is the ninth letter of the Latin alphabet. Conversely, Tab is \x09 or decimal 9, which supports my theory stated above. However, where might this be documented as fact?

© Super User or respective owner

Related posts about terminal

Related posts about encoding