Ble.sh: [bash-completion] Unexpected EOF when typing $ in arguments

Created on 5 Apr 2021  ·  6Comments  ·  Source: akinomyoga/ble.sh

ble version: 0.4.0-devel3+0506df2
(does not happen in 0.3.3+7fa584c)
Bash version: 5.1.4(1)-release x86_64-pc-linux-gnu

Typing $ inside a single quote in an argument, or \$ in a double-quoted argument causes the following error message:

bash: unexpected EOF while looking for matching `''
bash: syntax error: unexpected end of file
bash: unexpected EOF while looking for matching `''
bash: syntax error: unexpected end of file

Combinations I've tried:

  • echo '$' → error
  • echo "$" → OK
  • echo '\$' → OK
  • echo "\$" → OK
  • echo "\$thing" → error
External Bug compatibility

All 6 comments

Thank you for the report! I suspect this is related to a bug of scop/bash-completion (#189 #492).

  • Question 1: Does this reproduce after running complete -r? (complete -r removes all the programmable completion settings including the ones set up by bash-completion).

Question 1: Does this reproduce after running complete -r?

No, I'm able to type '$ without error messages.

OK, thank you! So this is caused by the bug of bash-completion. Maybe later I should update the PR #492. I was recently a bit busy so couldn't take the time to improve the PR.

@oc1024 Sorry for the long blank. In the commit 9d4ad56, I added a workaround for the bash-completion bug in ble.sh. ble.sh replaces the problematic function _quote_readline_by_ref with a fixed version. Now I believe the error messages will not be shown with bash-completion.

As for the root cause in bash-completion, I didn't have time to update the PR to include unit tests, but I'll update it sometime when I have time.

If you could confirm that the problem has been solved, you can close this issue now. Thank you!

Just reinstalled blesh from master and seems to be working. Thanks!

Hope this gets fixed upstream too, though.

Thank you!

Was this page helpful?
0 / 5 - 0 ratings