MedallionShell
MedallionShell copied to clipboard
Close #32 Searching for a file on the system path
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.
- 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).
- Invoking
Process.Start
on the executable itself (or callingwhere
on Windows,which
on Linux) is probably too expensive. - There's also a mention of the built-in API
PathFindOnPath
inshlwapi.dll
, but I wasn't sure if it was reliable.
Open Questions
- Should we use
PathFindOnPath
, or is searching forPATH
suffice? - Should we validate the length of the
executable
? - What other test cases do we want?
@madelson The test failures don't seem related to the updated code path, so requesting review!