Date: Sat, 17 Dec 2022 22:20:20 +0100 From: "Vincent Lefevre via austin-group-l at The Open Group" <austin-group-l@opengroup.org> Message-ID: <20221217212020.ga388...@zira.vinc17.org>
| What is the behavior of the QUIT character (^\) when typing a command | in an interactive sh shell? As you have seen, it varies, and is not specified anywhere I know of. | https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html just | says that if the shell is interactive, SIGQUIT shall be ignored. That just means that the shell doesn't exit with a core dump when the signal is generated (however it is generated, including via kill(2)). What happens depends upon the terminal settings, and how the shell chooses to implement command line editing (which is specified to exist, at least for vi mode - others are allowed as alternatives - but isn't specified how it works). If the shell isn't doing command line editing, the effects of the quit character on the terminal input buffer still occur (anything pending is flushed), if it is, then it all depend what (if anything) the Ctrl-\ (or other char that might be set as the quit char in termios) is defined to work in that editor - one can bind it to do almost anything in most shells (typing the character doesn't necessarily generate a SIGQUIT). kre