Skip to content

Attempting to tab complete after '${ errors #189

Closed

Description

@neerolyte

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.

Activity

  1. xlucn commented on Mar 15, 2021

    @xlucn

    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?

  2. akinomyoga commented on Mar 15, 2021

    @akinomyoga
    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.

  3. xlucn commented on Mar 15, 2021

    @xlucn

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions