Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: avoid hashing command names twice on Cygwin

> We could be more intellegent and test if stat(foo) != stat(foo.exe) to decide
> if we should add both. Is it worth troubles?
> OTOH it is just command table; for all purposes hashing foo is the same as
> hashing foo.exe except very rare cases when both exist.

It will be confusing if completion doesn't recognise foo.exe as an
executable under its full name.  Hashing both may not be necessary, but it
should preferably be stored and retrieved in such way that both are used
whenever an executable is being searched for.

A natural extension for DOS- and Windows-like environments which could even
be an option on other systems (you wouldn't want it turned on by default)
would be to do what 4DOS used to and take a list of executable suffixes and
interpreters, which could be taken from an array (ordinary so as to specify
precedence), e.g. 

zexecsufixes=(com: exe: pl:'/c/Programe Files/perl/perl.exe' zsh:zsh sh:bash)

where an empty string specifies that the file is already in an executable
format. That suggests that the programme would be stored under it's full
name, or at least with a suitable flag, but returned for completion both as
that and the basename.  But that's a lot of work.  (You could extend it to
shell functions, builtins etc., but that would probably just be asking for 

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070

Messages sorted by: Reverse Date, Date, Thread, Author