end of lines

References

Summary

Line endings are controlled by

  1. Carriage return: \r (ASCII value 13)
  2. Line feed: \n (ASCII value 10)

Linux and macOS use LF, while Windows uses CRLF (\r\n)

You can actually fix this, by not having a CR at all!

Carriage Return

On a physical type writer, the carriage return slid the typing carriage back to the left

^M (control M) is the keyboard shortcut for carriage return

Line Feed

On a typewriter, this moved the paper up, but didn't shift the carriage back to the left