Response to a recent claim that Ctrl+D in the terminal is like pressing Enter. It kind of is but it’s also misleading to say so without further explanation.
Yeah, my bad. I should have linked to the previous post: discuss.tchncs.de/post/3263718… (not entirely sure what’s the etiquette for linking to posts on Lemmy is).
Found it in the classic The UNIX Programming Environment from 1984:
But then, this is for return, which technically isn't "enter", but nowadays they are sort of interpreted the same by programs?
* In graphical applications, Ctrl+M, Ctrl+J and Return/Enter are all different things.
* In a terminal in raw mode, Ctrl+M and Return/Enter are the same thing but Ctrl+J is something different. You can for example run
bind -x '"\C-j":"echo a"'
in bash and Ctrl+J will do something different.* In a terminal in canonical mode, they are all the same thing. There probably are some
stty
options which can change that though.