minishell
minishell copied to clipboard
[BUG] minishell running in minishell prints too many newlines after exiting, also in subshells
This happens when first pressing Ctrl+C and then exiting. It's because when we print a newline depends on the exit code.
With a program that returns 130 we also print a newline. This also applies to subshells. The more nested subshells there are, the more newlines get printed.
It is now very clear that signals should be handled by the main shell process, not from the child processes.
There's also an additional newline when preemptively ending a heredoc with CTRL+D and then CTRL+C.