Bug: Fuzzy tab-completion fails on a file inside a directory with parentheses
fish version: 3.6.1 OS: macOS & Arch Linux Bug occurs without customizations? Yes
Steps to reproduce:
$ mkdir mydir\(parens\)
$ touch mydir\(parens\)/stuff.txt
$ cat mydir\(parens\)/<TAB> # this fills in "stuff.txt" as expected
$ cat mydir\(parens\)/s<TAB> # same here
$ cat mydir\(parens\)/txt<TAB> # this does nothing :(
$ cat 'mydir(parens)/'txt<TAB> # same here
I'm not sure if this is the same bug or not but fuzzy completion also fails if the directory contains a wildcard:
$ mkdir mydir
$ touch mydir/stuff.txt
$ cat mydir/txt<TAB> # this fills in "stuff.txt" as expected
$ cat mydi*/<TAB> # same here
$ cat mydi*/txt<TAB> # this does nothing :(
Interestingly, in addition to not completing the filename, the line also doesn't "flash" like it does for other failed completions. For example:
$ mkdir mydir
$ touch mydir/stuff.txt
$ cat mydir/nope<TAB> # this flashes the command line
$ cat mydi*/nope<TAB> # same here
$ cat mydi*/txt<TAB> # this doesn't complete the filename AND doesn't flash
It's as if fish is able to find the file but doesn't complete it.
Nice find, probably it's because REPLACE_UNCLEAN = L"$*?({})"; is too crude. We should instead use something like parse_util_locate_cmdsubst_range to determine whether a string token contains command substitutions