It looks like the main signal handler is still the main process, not the subshell process.
SIGQUIT in this example should quit the entire subshell, not just cat:
We still print 123 in this example.
This issue also causes (cat) | (cat) to print too many newlines when Ctrl+C.
This also makes it apparent: (cat || echo 1 && exit 2) || echo $?
It looks like the main signal handler is still the main process, not the subshell process.
SIGQUITin this example should quit the entire subshell, not just cat:We still print
123in this example.This issue also causes
(cat) | (cat)to print too many newlines when Ctrl+C.This also makes it apparent:
(cat || echo 1 && exit 2) || echo $?(((cat)))also prints another newline for every subshell. - [BUG] minishell running in minishell prints too many newlines after exiting, also in subshells #257