Repository: junegunn/fzf (language: go)

Issue:
Directories not walked recursively in FUSE mounted directories
### Checklist

- [X] I have read through the manual page (`man fzf`)
- [X] I have searched through the existing issues
- [X] For bug reports, I have checked if the bug is reproducible in the latest version of fzf

### Output of `fzf --version`

0.52.1 (6432f00)

### OS

- [X] Linux
- [ ] macOS
- [ ] Windows
- [ ] Etc.

### Shell

- [ ] bash
- [X] zsh
- [ ] fish

### Problem / Steps to reproduce

1. Create test directories and files:
```sh
$ mkdir -p test/test mnt
$ touch test/test/test{1,2,3,4,5} test/test6
```
2. Enter `test` and try to complete files:
```sh
$ cd test
$ stat **<TAB>
```
3. As expected it shows all files and dirs:
```sh
$ stat **
>
  7/7 (0) ───────────
> test6
  test
  test/test5
  test/test2
  test/test1
  test/test3
  test/test4 
```
5. Mount `test` to `mnt` over `ssh`
```sh
$ cd ..
$ sshfs localhost:test mnt
```
6. Enter `mnt` and try to complete files:
```sh
$ cd mnt
$ stat **<TAB>
```

Expected result: same as for local filesystem
Actual result: only top level items are listed
```sh
$ stat **
>
  2/2 (0) ───────────
> test
  test6 
```

Now the really weird thing is that for some commands it works fine in both cases `ls **<TAB>` or `cat **<TAB>`, but not in others `vim **<TAB>` or `mpv **<TAB`.


Discussion / hints:
Do you have any custom configuration?

```sh
env | grep FZF_

print -l ${(ok)functions} | grep _fzf_compgen
```
Turns out it's an issue caused by caching mechanism in `sshfs`see libfuse/sshfs#306 for details.

It started to affect `fzf` with switch to new `fastwalk` based walker. It relies on proper `d_type` returned by `getdents` syscall (translated to `readdir` in FUSE). If the type is unexpected bogus one is [returned](https://github.com/charlievieth/fastwalk/blob/9e83309be824b060180b1365fe282b5557d2b1a7/internal/dirent/dirent_linux.go#L49) which later fails to meet criteria for [recursive walk](https://github.com/charlievieth/fastwalk/blob/9e83309be824b060180b1365fe282b5557d2b1a7/fastwalk.go#L335-L337).

On the other hand previous `find` based walker, which uses `fts_read` internally, will [call `stat`](https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/fts.c;h=5a86419c748b8a1592851df6cd2d17b699939ca3;hb=HEAD#l1534) for each file with unknown type (`DT_UNKNOWN`) resulting in recursive walk.
Also submitted charlievieth/fastwalk#18 to match `find`'s behavior cause ie `gvfs` FUSE mount does not populate `stat` in `readdir` at all.

Fix patch:
diff --git a/go.mod b/go.mod
index 0473784b1ee..4ab498033eb 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,7 @@
 module github.com/junegunn/fzf
 
 require (
-	github.com/charlievieth/fastwalk v1.0.3
+	github.com/charlievieth/fastwalk v1.0.4
 	github.com/gdamore/tcell/v2 v2.7.4
 	github.com/mattn/go-isatty v0.0.20
 	github.com/mattn/go-shellwords v1.0.12
diff --git a/go.sum b/go.sum
index c1bf2d2dac4..c0ccde0c612 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/charlievieth/fastwalk v1.0.3 h1:eNWFaNPe5srPqQ5yyDbhAf11paeZaHWcihRhpuYFfSg=
-github.com/charlievieth/fastwalk v1.0.3/go.mod h1:JSfglY/gmL/rqsUS1NCsJTocB5n6sSl9ApAqif4CUbs=
+github.com/charlievieth/fastwalk v1.0.4 h1:EG3y5L1XBa8VftvpONuQlfe5sNuf1xzGpm59bdgCDwo=
+github.com/charlievieth/fastwalk v1.0.4/go.mod h1:JSfglY/gmL/rqsUS1NCsJTocB5n6sSl9ApAqif4CUbs=
 github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
 github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
 github.com/gdamore/tcell/v2 v2.7.4 h1:sg6/UnTM9jGpZU+oFYAsDahfchWAFW8Xx2yFinNSAYU=


Test patch: