#805375 dash: interactive dash mishandles the quit character (^\)

Package:
dash
Source:
dash
Description:
POSIX-compliant shell
Submitter:
Vincent Lefevre
Date:
2015-12-07 01:30:08 UTC
Severity:
normal
#805375#5
Date:
2015-11-17 13:31:43 UTC
From:
To:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sh.html
says:

  If the shell is interactive:
    SIGQUIT and SIGTERM signals shall be ignored.

The behavior of dash is correct when the signal has been sent with
"kill" from another terminal, but if I type "foo", then the quit
character (Ctrl-\ by default), then "bar", I get:

$ foo^\bar
dash: 1: bar: not found

instead of:

$ foobar
dash: 1: foobar: not found

#805375#8
Date:
2015-12-06 22:22:11 UTC
From:
To:
Dash is behaving correctly here. The flush of the input queue occurs
because the NOFLSH flag is not set in termios c_lflag. After 'stty
noflsh', there is still '^\' visible but the characters before it are
not discarded. The default (to flush) is probably more useful, though.

#805375#13
Date:
2015-12-07 01:27:29 UTC
From:
To:
The behavior is different with bash and zsh, but I suppose that this
is because neither bash nor zsh uses the cooked mode.

Well, if the signal is ignored, then it is more intuitive to disable
flushing, IMHO, i.e. to ignore Ctrl-\ entirely. However the terminal
handling is buggy in this case (I mean, if one types "foo" then Ctrl-\
then [Backspace], only the backslash is erased so that one gets "foo^"
displayed instead of "fo").