fix: set WorkingDirectory in PowerShell Invoke-AtuinSearch#3351
Conversation
Greptile SummaryMinimal, correct fix for the directory filter mismatch in PowerShell. Sets Important Files Changed
Reviews (1): Last reviewed commit: "fix: set WorkingDirectory in PowerShell ..." | Re-trigger Greptile |
247fb8a to
dbfe19e
Compare
Yep that makes perfect sense, updated!
My daily driver is a mac so I'm only occasionally on PowerShell. I was excited to see atuin available on Windows, then saddened when the directory filter didn't work the way I knew and loved ;) |
|
Sorry to bother you again, but I was in a hurry when I wrote my previous comment. According to this SO answer, the most robust way to get the filesystem path is: I would never had thought that
|
Use (Get-Location -PSProvider FileSystem).ProviderPath to reliably get the filesystem path, since $PWD is a writable automatic variable that can be overwritten.
dbfe19e to
c8b4400
Compare
|
No worries, updated! :) thanks. |

Fixes #3350
PowerShell's Set-Location (cd) doesn't update the process-level working directory, so the spawned search process sees a stale cwd and directory filter mode matches against the wrong directory. Setting
WorkingDirectoryon theProcessStartInfoensures the correct cwd is passed through.