TLDR; Ctrl+J inserts a newline in Readline because J is the 10th letter of the alphabet and the tradition of all the dead generations weighs like a nightmare on the brain of the living.
Using Ctrl+J to insert a new line has a history that spans hardware engineering, OS design, and early text editors. Its lineage can be traced through three major layers: ASCII and Teletype hardware, Unix TTY drivers, and Emacs/GNU Readline.
The Hardware & ASCII Layer (1960s) #
In the ASCII character set (standardized in 1963), every letter corresponds to a number:
- J is the 10th letter of the alphabet.
- Pressing the Ctrl modifier key on early terminals (like the Teletype Model 33) literally performed a bitwise AND operation on the key's signal, clearing the 5th and 6th bits (subtracting 64).
- Subtracting 64 from J's uppercase ASCII value (74) results in 10.
- In ASCII, character 10 is designated as LF (Line Feed).
On physical teletypewriters, sending a Line Feed (Ctrl+J) instructed the hardware to roll the paper up by one line. Sending a Carriage Return (Ctrl+M, as M is the 13th letter) returned the print head to the left margin.
The Unix TTY Layer (1970s) #
When Unix was created, the developers chose to simplify text handling by using
a single character for newlines: the Line Feed (\n, ASCII 10).
Because physical keyboard "Return" keys sent a Carriage Return (\r or
Ctrl+M), Unix terminal drivers introduced a system configuration called
ICRNL (Map Carriage Return to Newline on Input). When you press Enter,
the Unix TTY driver translates that Ctrl+M (\r) into Ctrl+J (\n) before
delivering it to applications.
As a result, in Unix, Ctrl+J is the raw, untranslated representation of a system newline.
The Emacs and Readline Layer (1970s–1980s) #
When terminal-based text editors were developed, they needed a way to distinguish between "submit/execute this command" and "insert a literal newline in this buffer."
- Emacs (1976): In Emacs, the Enter key (Ctrl+M) was bound to
submitting or executing, while Ctrl+J was bound to the
newline-and-indentcommand (inserting a physical newline and matching the indentation level). - GNU Readline (1989): Readline, the command-line editing library used by Bash, Python, and many interactive CLI tools, heavily copied Emacs keybindings. Readline bound both Ctrl+M and Ctrl+J to accept/execute the line in standard input buffers, but left-over Emacs-like environments and multiline TUI text fields retained Ctrl+J as the standard, direct escape hatch for inserting a literal newline without submitting.
Summary #
Ctrl+J inserts a newline because J is the 10th letter of the alphabet, mapping it directly to ASCII 10 (Line Feed). Unix adopted Line Feed as its native newline, and Emacs/Readline solidified it as the standard keyboard shortcut to bypass TTY submission and insert a physical line break.