1

Anyone know why ctrl-m and return are the same control chars?

2 Answers2

1

Carriage return or /r has ASCII/Unicode code point 13. m is the 13th letter of the alphabet.

Control codes go from ctrl-a (code point 1), ctrl-b (code point 2) … ctrl-z (code point 26), then Esc (code point 27), 4 more control characters, space, then the rest.

  • "control codes" go from from ^@ (0) to ^_ (0x1f), with ^? (0x7f) being an outlier. They're translated from caret notation to ascii value by xor-ing them with 0x40: #define CTRL(c) ((c) ^ 0x40). The space is not a control character. –  Aug 04 '19 at 23:28
0

CTRL+m and CTRL+j are simply "shortcuts" or alternative keys for return

See The List Of Useful Bash Keyboard Shortcuts

jesse_b
  • 37,005