kelleyma49 / PSFzf

A PowerShell wrapper around the fuzzy finder fzf
MIT License
802 stars 37 forks source link

Git preview failed when set-location use System.IO.DirectoryInfo Object #162

Closed belotn closed 2 years ago

belotn commented 2 years ago

Hi

That's a weird one.... When using a Get-Item to Set-Location, powershell pwd is not "correct" and then Invoke-FuzzyGitStatus preview failed...

image

using a string with set-location is ok

image

the better way to resolve the issue is to ask ms to correct powershell... The fastest is to change line in function Invoke-PsFzfGitFiles

`$previewCmd = "${script:bashPath} \""" + $(Join-Path $PsScriptRoot 'helpers/PsFzfGitFiles-Preview.sh') + "\"" {-1}" + $(Get-ColorAlways) + " \""$pwd\"""`

to

$previewCmd = "${script:bashPath} \""" + $(Join-Path $PsScriptRoot 'helpers/PsFzfGitFiles-Preview.sh') + "\"" {-1}" + $(Get-ColorAlways) + " \""$($pwd.ProviderPath)\"""

kelleyma49 commented 2 years ago

@belotn , please try the 2.5.2 prelease and let me know if that fixes your issue

https://www.powershellgallery.com/packages/PSFzf/2.5.2-alpha

belotn commented 2 years ago

@kelleyma49 It's ok. Works as expected :)