malxau / yori

Yori is a CMD replacement shell that supports backquotes, job control, and improves tab completion, file matching, aliases, command history, and more.
http://www.malsmith.net/yori/
MIT License
1.24k stars 31 forks source link

Skip directories when finding executables in PATH #102

Closed jstarks closed 2 years ago

jstarks commented 2 years ago

Currently, yori will try to run a directory notepad.exe if it's in the PATH, or will try to run . or .. if typed. This leads to confusing access denied error messages.

Instead, when searching for candidate executables, filter out directories.

malxau commented 2 years ago

If it's valid to execute foo.docx or http://foo and it just gets handed to ShellExecute, should we do the same thing with directories, thereby opening explorer? In both cases the likely result is launching a GUI program, and it sounds like executing a directory is guaranteed to fail today.