fzf icon indicating copy to clipboard operation
fzf copied to clipboard

[Feature request] Exclude duplicated folders in macOS

Open flanter21 opened this issue 11 months ago • 1 comments

Checklist

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

Output of fzf --version

0.57.0 (brew)

OS

  • [ ] Linux
  • [x] macOS
  • [ ] Windows
  • [ ] Etc.

Shell

  • [ ] bash
  • [ ] zsh
  • [ ] fish

Problem / Steps to reproduce

macOS binds what is essentially the root directory* to several points via both mounting and symlinks. This means, by default, it is not possible to avoid searching the same folders at least twice if you do it in the root directory. For example, searching for "Macintosh HD" leads to both /Volumes/Macintosh HD and /System/Volumes/Data/Volumes/Macintosh HD

This is rather unintuitive and I suggest the default configuration on Mac being changed to avoid this problem, or an option to exclude a folder being searched more generally.

*The only difference it that the symlinked root has a bin folder that is not present in any of the mounted ones and the mounted one has a MobileSoftwareUpdate folder not found in the symlinked one.

Root directory examples Symlinks

  • /
  • /Volumes/Macintosh HD
  • /Volumes/Macintosh HD/Volumes/Macintosh HD

Mount

  • /System/Volumes/Data

Both

  • /Volumes/Macintosh HD/System/Volumes/Data
  • /System/Volumes/Data/Volumes/Macintosh HD
  • /System/Volumes/Data/Volumes/Macintosh HD/System/Volumes/Data etc

Edit

Also a similar problem can be obtained as the /System/Volumes/Data folder may be linked into certain apps working sandboxes. eg. searching for "file" in my downloads folder led to

/Users/pc/Library/Containers/com.utmapp.UTM/Data/Downloads/file /Users/pc/Library/Containers/com.utmapp.UTM/Data/Downloads/file /Users/pc/Library/Containers/com.apple.podcasts/Data/Downloads/file /Users/pc/Library/Containers/com.apple.FaceTime/Data/Downloads/file x100

flanter21 avatar Jan 19 '25 21:01 flanter21

I think I am also running into this (or atleast a similar) issue. For instance I have gimp-3.0.4-arm64.dmg in my Downloads folder, then every folder containing a symlink to downloads will show up in fzf results. See image.

System: MacBook M3Pro OS: macOS 15.5 Aarch: arm64

Image

ajinkya-k avatar Jul 17 '25 19:07 ajinkya-k