Commands should not be resolved in cwd #150

Closed
opened 2020-12-07 14:38:43 +01:00 by FWDekker · 0 comments
Owner

If cwd is ~ and the command ~/example exists, then executing example should never execute ~/example, even if /bin/example does not exist. That is, after implementing #148, cwd should not be on path.

Therefore, if the command (i.e. first word) of a line contains no slashes, then look up from path. Otherwise, look up normally (i.e. relative or absolute, depending on the path).

The only exception here is directories. These work as follows: If no slash, then look up from path, otherwise normal resolution but RETURN ONLY IF DIRECTORY. If slash, normal resolution applies.

If cwd is `~` and the command `~/example` exists, then executing `example` should never execute `~/example`, even if `/bin/example` does not exist. That is, after implementing #148, cwd should not be on path. Therefore, if the command (i.e. first word) of a line contains no slashes, then look up from path. Otherwise, look up normally (i.e. relative or absolute, depending on the path). The only exception here is directories. These work as follows: If no slash, then look up from path, otherwise normal resolution but RETURN ONLY IF DIRECTORY. If slash, normal resolution applies.
FWDekker added the
enhancement
label 2020-12-07 14:38:43 +01:00
FWDekker self-assigned this 2020-12-07 14:38:43 +01:00
Sign in to join this conversation.
No description provided.