3 ms·
CTRL + D is news to me, i’m a \q guy too.
by shrumm 8y ago
CTRL + D is news to me, i’m a \q guy too.
- stingraycharles 8y agoCtrl+D is more generic, as it sends the signal to close the pipe (i.e. stdin from the perspective of psql).
- JimDabell 8y agoIt's a standard quit command for shells in UNIX – e.g. if you hit ^D in a Bourne shell it will exit as well.
- derefr 8y agoIt's not really a "command", though. Unlike, say, Ctrl+C, which becomes a SIGINT signal that the program receives and gets to decide how to handle, Ctrl+D never reaches the program as a separate recognizable thing that you can write a handler for. Instead, Ctrl+D is the way to ask the TTY driver to pass the program an EOF instead of input in response to its next read(2) call to its stdin. It's the same signal that the program would receive if you had been piping input into the program from a file, and that file reached the end. Thus, any CLI program built to handle being piped into, will "automatically" support Ctrl+D as a way to quit out of it.