On Fri, Jul 21, 2023 at 9:14 AM Dale R. Worley <wor...@alum.mit.edu> wrote: > (...) > Also, you don't state explicitly what you think the error is. I assume > you mean that "Press [ctrl-d] again and tab (tty 5) crashes." should not > be happening. > > But it looks to me like you're sending ctrl-d into a shell. That, of > course, is EOF, and usually tells the shell to exit. If it's a login > shell, the whole login session ends.
One thing that comes to mind is that there was a behavior change in 5.2 around how EOF is handled while the parser is looking for a matching quote. For example, with Bash 5.1 (note: <Return> indicates pressing the Return key in the prompt) bash-5.1# echo '<Return> > <Ctrl-d> bash: unexpected EOF while looking for matching `'' bash: syntax error: unexpected end of file bash-5.1# GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-musl) And Bash 5.2 bash-5.2# GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-musl) bash-5.2# echo '<Return> > <Ctrl-d> bash: unexpected EOF while looking for matching `'' > <Ctrl-d> exit In 5.1, when you input a command that has an unpaired quote and then input Ctrl-d you get a syntax error and return to the primary prompt. When you do the same in 5.2, the first Ctrl-d will show an unexpected EOF message but you will remain in the secondary prompt. A second Ctrl-d will then cause Bash to exit. This change was discussed in https://mail.gnu.org/archive/html/bug-bash/2023-02/msg00145.html