Is Ctrl+D really like Enter?


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.


Linux Terminal: CTRL+D is like pressing ENTER


Honestly I had no idea what ctrl+d even did, I just knew it was a convenient way for me to close all the REPL programs I use. The fact that it is similar to pressing enter really surprised me, so I wanted to share this knowledge with you :)


https://hackarcana.com/article/ctrl-d-is-like-enter

This entry was edited (1 month ago)
in reply to pmk

Yeah, it’s a bit philosophical.
* 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.
This entry was edited (1 month ago)
in reply to hendrik

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).


Linux Terminal: CTRL+D is like pressing ENTER


Honestly I had no idea what ctrl+d even did, I just knew it was a convenient way for me to close all the REPL programs I use. The fact that it is similar to pressing enter really surprised me, so I wanted to share this knowledge with you :)


https://hackarcana.com/article/ctrl-d-is-like-enter

in reply to mina86

That's right. I don't think there is a good way to do it. I just take whatever link is provided by the small Fediverse icon. But I don't think it matters that much for your audience, they're spread over several instances and it'll be an external link for some of them, no matter what you do. I'm not sure whether we have the ambition to solve this. I don't see anything the user could do. Either this gets handled in some way by the software, or it is how it is.
This entry was edited (1 month ago)