> \n is ^J (ctrl-J) so there's some logic there
The same 'j' as vi uses for 'hjkl'. https://vi.stackexchange.com/questions/42426/why-did-vi-use-...
> \n is ^J (ctrl-J) so there's some logic there
The same 'j' as vi uses for 'hjkl'. https://vi.stackexchange.com/questions/42426/why-did-vi-use-...
also the same 'j' found in words like 'jujuism', 'jejunities', and 'bejeezus', also by a magical coincidence the same one in most Latin fonts, and even some random text strings such as 'pj$4'
But I suppose you're saying ASCII 10 was chosen as newly because it aligns with the down arrow on keyboards of the time. Maybe.
Other way around. ASCII classified control characters into blocks and newline ended up a bit-flip away from J, so the ADM-3A printed ‘↓’ on the ‘J’ key.
Yes, and ADM-3A also had "↑" on the "K" key, because \013 is vertical tabulation (VT), and "→" on the "L" because \014 is form feed (FF). It all makes perfect sense.
If terminfo database is to be believed, quite a lot of other terminals reused this control sequences too, for some reason.
> I suppose you're saying ASCII 10 was chosen as newly because it aligns with the down arrow on keyboards of the time. Maybe.
The linked StackExchange has it as:
> What character was used for what control code was mostly a matter of bitwise arithmetics. LF is ^J because J happens to be at the corresponding location in the corresponding column of the table (+ 64 in decimal)
and did they choose that code because the J key had a down arrow printed on it?
No, it's ^J because `J` is 0x4A in ASCII and `\n` is 0x0A, just as `I` is 0x49 and `\t` (tab, ^I) is 0x09.
In the stone age, pressing CTRL flipped that bit, so ^J is literally "ctrl-J".
You're saying the same thing. vi uses ‘j’ because the ADM-3A printed ‘↓’ on the ‘J’ key because Control-J is newline because the code is J with a bit flipped because bit-flipping was practical on an electromechanical teletype.