MedallionShell icon indicating copy to clipboard operation
MedallionShell copied to clipboard

Close #32 Searching for a file on the system path

Open Bartleby2718 opened this issue 11 months ago • 9 comments

Notes

Picked up this ticket because it seemed interesting, even though it was not in the 1.7 milestone.

Context

There are a few different suggested approaches in this StackOverflow thread.

  1. I went with the most upvoted answer, which seemed most reasonable and straightforward to me. Filing a PR to see if a variation of it works on Linux. I have not found any executables that didn't work with this approach (on Windows 11).
  2. Invoking Process.Start on the executable itself (or calling where on Windows, which on Linux) is probably too expensive.
  3. There's also a mention of the built-in API PathFindOnPath in shlwapi.dll, but I wasn't sure if it was reliable.

Open Questions

  1. Should we use PathFindOnPath, or is searching for PATH suffice?
  2. Should we validate the length of the executable?
  3. What other test cases do we want?

Bartleby2718 avatar Mar 10 '24 20:03 Bartleby2718

@madelson The test failures don't seem related to the updated code path, so requesting review!

Bartleby2718 avatar Mar 10 '24 21:03 Bartleby2718