bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: git amend commit with backticks on cli causes tty to crash


From: Ángel
Subject: Re: git amend commit with backticks on cli causes tty to crash
Date: Sun, 30 Jul 2023 15:40:42 +0200

On 2023-07-20 at 10:31 -0700, Wiley Young wrote:
> But of course, I forgot the second single quote! Press [Ctrl-d].
> 
> #+++++++++++++++++++++++++++
> bash: unexpected EOF while looking for matching `''
> #+++++++++++++++++++++++++++
> 
> Add one single quote, press [Ctrl-d}; no response. Press [enter] and
> [ctrl-d]:
> 
> #+++++++++++++++++++++++++++
> bash: unexpected EOF while looking for matching `''
> #+++++++++++++++++++++++++++
> 
> Press [ctrl-d] again and tab (tty 5) crashes.

This is not a bug. It can be simplified as:

$ echo '
> ^D
bash: unexpected EOF while looking for matching `''
bash: syntax error: unexpected end of file
$ ^D
<bash closes>

A ^D (Ctrl+D) sends an EOF.

If you have a command with incomplete quoting when it reaches EOF,
bash complains "unexpected EOF while looking for matching" and stops
the parsing.

At this point you are at a normal shell prompt, not continuing the
previous command.
If you do a Ctrl-D instead of entering any command, bash finishes. And
the tty is closed when the shell finishes, as well as your xfce4-
terminal tab (some terminal emulators have a configuration setting for
not closing the tab, though). It's not a crash.

Regards






reply via email to

[Prev in Thread] Current Thread [Next in Thread]