Open spenserblack opened 1 day ago
I think I know what the problem is for Yazi (and likely zoxide, too). Yazi has this recommended wrapper for PowerShell to CD into the last directory used:
function y {
$tmp = [System.IO.Path]::GetTempFileName()
yazi $args --cwd-file="$tmp"
$cwd = Get-Content -Path $tmp
if (-not [String]::IsNullOrEmpty($cwd) -and $cwd -ne $PWD.Path) {
Set-Location -LiteralPath $cwd
}
Remove-Item -Path $tmp
}
I don't know much PowerShell, but I'm guessing that @Wu-Felix's issue is caused because the custom Set-Location
takes -Path
, but the Yazi wrapper uses -LiteralPath
. So the y
wrapper fails to CD ("jump").
Perhaps this can be easily fixed by accepting and passing any parameter from the custom Set-Location
to the builtin Set-Location
for better compatibility? Here's a simple example of what I mean:
function Set-Location-Proxy {
# do something
Set-Location @args
}
cc @kiapanahi
I'd happily accept a PR from either of you 🙂
Originally posted by @Wu-Felix in https://github.com/o2sh/onefetch/issues/1452#issuecomment-2470462841