fd icon indicating copy to clipboard operation
fd copied to clipboard

fd does not want to work when cwd is non existent

Open Zykino opened this issue 2 years ago • 3 comments

What version of fd are you using? fd 8.3.1 fish, version 3.3.1

$ cd /mnt/path/to/some/external/drive
# Unmount the drive
# Remount the drive at the same space (may not be necessary)
fdfind someFolder /home/zykino/some/path/
[fd error]: Could not retrieve current directory (has it been deleted?).

I think this is a bug: when providing a path the cwd should not be accessed.

Zykino avatar Jul 31 '22 14:07 Zykino

I happened to run into this issue too and fixed it since I agree fd shouldn't care about the current working directory when a search path is provided. For the record, an easier way to reproduce:

$ mkdir testdir
$ cd testdir
$ rmdir $PWD
$ fd foo /tmp
[fd error]: Could not retrieve current directory (has it been deleted?).

sharkdp, how do you feel about this issue - do you agree this is a bug?

vijfhoek avatar Jul 31 '22 21:07 vijfhoek

@vijfhoek that commit looks good to me.

tmccombs avatar Jul 31 '22 23:07 tmccombs

sharkdp, how do you feel about this issue - do you agree this is a bug?

Yes, thank you for creating a fix!

sharkdp avatar Aug 03 '22 06:08 sharkdp