What is the behavior of the QUIT character (^\) when typing a command
in an interactive sh shell?

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html just
says that if the shell is interactive, SIGQUIT shall be ignored.

Results with various POSIX and non-POSIX shells:

With bash 5.2.2, mksh 59c and fish 3.5.1, typing ^\ is entirely ignored.

With yash 2.52 and zsh 5.9, ditto, but with a terminal beep.

With ksh93 93u+m/1.0.4, it produces a ^\ character:

$ echo a^\b | hd
00000000  61 1c 62 0a                                       |a.b.|
00000004

With dash 0.5.11+git20210903+057cd650a4ed-9, it discards all the
characters already typed (with the "stty -noflsh" default).

With posh 0.14.1, it aborts the command line and a new prompt is
displayed.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

  • behavior of the QUIT... Vincent Lefevre via austin-group-l at The Open Group

Reply via email to