5 ms·
What other apps use Ctrl+D ? I can't think of a single one.
by threeseed 8y ago
What other apps use Ctrl+D ? I can't think of a single one.
- beardicus 8y agopython and node REPLs both do this.
- 1stranger 8y agoPractically any interactive shell. python or bash for instance. It's everywhere.
- TheDong 8y agoAny command-line that uses readline[0], which in practice is an absolute ton of things. This includes nodejs's repl, irb, ed, gdb, tftp, virsh, gpg --card-edit, and others. It also works for programs that read stdin as if it's a file if you're using a modern readline shell to run them (e.g. cat, tee, etc) [0]: https://en.wikipedia.org/wiki/GNU_Readline https://en.wikipedia.org/wiki/GNU_Readline
- mortehu 8y agoIt has nothing to do with readline, but is a feature of the TTY (i.e. implemented inside the kernel) when in canonical mode. It will work for anything that exits in reaction to read(STDIN_FILENO, ...) returning zero.
- deleted 8y ago[deleted]
- drb91 8y agoMost apps that read from stdin handle EOF correctly.
- LukeShu 8y agoIn a terminal in cooked mode, Ctrl+D sends EOF. Literally any program that reads from stdin and doesn't do something special to avoid it will handle Ctrl+D. That's the point about why it's worth it to learn: It's universal to all terminal programs, even if the author of the program didn't know about it.