Closed mattcargile closed 2 years ago
Maybe this function could be utilized?
See main post. This comment is no longer as relevant.
So fd.exe
has an --absolute-path
that could be used to mimic the output of dir /B /S
. It doesn't appear there is a flag on dir
to output the relative path.
Then this code could be changed.
to something like
$fileList = $files -join ' '
Then we could add a -PathType
or the like to Get-FileSystemCmd
Those are my ideas. Not sure what you think @kelleyma49?
Working on the Get-FileSystemCmd
, I'm not sure how we can tell if the user is using fd.exe
easily in their FZF_DEFAULT_COMMAND
. A user could conceivably pipe a command line tool into fd.exe
in this variable. This would make a pattern match like 'fd*'
maybe not as accurate.
Like on this line.
https://github.com/kelleyma49/PSFzf/blob/0843f35b0e77101f0718e89bb075e20e4e211d23/PSFzf.Base.ps1#L49
Should we be adding the --absolute-path
here anyway. I would prefer it that way because usually I don't want the full path in my fzf
output.
Description
Using
fd.exe
which returns relative paths as opposed todir /B /S
which returns the full name, the code below can return a path likeC:\my path\".\myfile.txt"
fromJoin-Path
. https://github.com/kelleyma49/PSFzf/blob/0843f35b0e77101f0718e89bb075e20e4e211d23/PSFzf.Functions.ps1#L71To Reproduce
Behavior
In VS Code the file
test
andfile.txt
are created that don't exist.Module Version
2.3.1-alpha
Shell
PowerShell 7.2.1
Reference Issue
issue.