entering text in the terminal is complicated https://jvns.ca/blog/2024/07/08/readline/
Entering text in the terminal is complicated

Entering text in the terminal is complicated

Julia Evans

someone in the replies elsewhere pointed out that Ctrl+J = 10 in the ASCII table = LF ("line feed") = Enter (because J is the 10th letter of the alphabet)

so Ctrl+J is the same as pressing enter

which I don't have any practical use for but is kind of cool

(edit: some corrections in this reply: https://pgh.social/@ben/112752235264922484)

Ben Cox (@[email protected])

@[email protected] This isn't quite right in a few ways. LF is decimal 10, ascii 0x0a. It is 10 because it's the 10th letter of the alphabet, though. But it's not the same as pressing enter except in cooked tty modes, where the terminal driver converts the return key (^M, \r, ASCII 13 / 0x0d) to a newline (^J, LF, 10/0xa) which your program then sees as its input.

pgh.social
@b0rk one practical use for it is if your terminal becomes wonky. For example, characters not echoing and enter key not actually working. I've seen this when interrupting an ssh connection before being fully established. You can type 'stty sane' followed by a Ctrl+J and get it back. I do this at least four to five times a year.
@tildetodd “reset” is easier to remember & also fixes a borked terminal
@hober definitely true, and I use it quite often to fix paste issues in macOS, but "stty sane" is heavily engrained muscle memory from using it on older UNIX boxes.