Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to tab complete after '${ errors #189

Closed
neerolyte opened this issue Mar 1, 2018 · 3 comments · Fixed by #492
Closed

Attempting to tab complete after '${ errors #189

neerolyte opened this issue Mar 1, 2018 · 3 comments · Fixed by #492

Comments

@neerolyte
Copy link

Something in bash-completion appears to break after trying to tab complete '${ in a file position e.g

$ ls -- '${-bash: unexpected EOF while looking for matching `}'
-bash: syntax error: unexpected end of file
$ rm -- '${-bash: unexpected EOF while looking for matching `}'
-bash: syntax error: unexpected end of file

I had a directory in my $PWD at the time named like ${FOO} but this isn't required for the unexpected EOF error to show up.

@xlucn
Copy link

xlucn commented Mar 15, 2021

It might be the same issue, here a case that resulted in similar error message for the first time, crashed the second time:

$ "$(dirname "$(base[Tab the first time]bash: unexpected EOF while looking for matching `)'
$ "$(dirname "$(base[Tab the second time]free(): double free detected in tcache 2
Aborted (core dumped)

Actually, how do I quickly test bash without bash-completion? On arch linux I uninstalled the bash-completion package, but the bug still appears. I tried fresh start from a new terminal or tty, and reboot, and bash --noprofile --norc.

Since my case only involves in command completion, could this be a bash bug?


Edit: I tried tab after ls -- '${ after uninstalling bash-completion, and there was no error, only normal Display all xxx possibilities?. Does this mean that my case is not the same?

@akinomyoga
Copy link
Collaborator

Does this mean that my case is not the same?

@OliverLew I think this is a different issue. The reasons are

  1. First, as you have reported in bug-bash mailing list (2021-03/msg00048), the error message by "$(dirname "$(baseTab happens even without bash-completion in Bash 5.1. While, the error message by ls -- ${Tab happens only when bash-completion is loaded.
  2. The error message with "$(dirname "$(baseTab happens with Bash 5.1 but not with Bash 5.0 or smaller version of Bash. While, this issue was created on 2018-01-05 which predates Bash 5.1 (2020-12) and Bash 5.0 (2019-01).

Actually, the issue reported here on 2018-01 is related to my pull request #492 (which was somehow neglected by @scop). After the fix #492, this error message after ls -- '${Tab doesn't happen. On the other hand, the issue reported by @OliverLew on 2021-03 is clearly a bug of Bash so should be discussed in bug-bash mailing list.

@xlucn
Copy link

xlucn commented Mar 15, 2021

@akinomyoga Thanks for the analysis and more testing with different versions of bash. Well, it's right to file the bug report to bash then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants