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

Re: <Tab> completion does not insert a slash




Are there any subdirectories inside src/python/ ?  The only case in
which I can get this to reproduce is when there's nothing more to
complete.

Yes, there are four subdirectories and a bunch of files.

% ls src/python/
API CMakeFiles CMakeLists.txt XYZ Makefile.am Apps, etc.

What strikes me is that the completion provides different results depending on whether the final slash is real or "transient" (hopefully I'm using correct terminology).

# All the following provide the same result:
% cd src/pyt<Ctrl+D>
% cd src/python<Ctrl+D>
% cd src/python/<Ctrl+D>    # the final slash is transient
-- directory after cdablevar --
-- local directory --
python/

But in this case, the result is different.
% cd src/python/<Ctrl+D>    # the final slash is real
-- directory after cdablevar --
-- local directory --
API/         Apps/        CMakeFiles/  XYZ/

Maybe the behaviour is expected, but I would expect the transient slash to work exactly the same way a real slash does.

After I've discovered the 'description' zstyle option, I'm observing how the completion works and find it even more confusing.
For example, in my Ubuntu system, the standard 'watch' command is located in /usr/bin. The /bin dir is actually a symlink to the /usr/bin/dir. And I have an alias called 'which', which expands to itself and adds two extra arguments.

% whence -a watch                                                    
watch --interval=0.3 tail -50
/usr/bin/watch
/bin/watch

BUT, trying to complete it in a command position identifies it either as a named directory, or as a parameter. (?!)

% wa<Ctrl+D>                                                                
-- external command --
-- executable file --
-- builtin command --
-- alias --
-- parameter --
-- named directory --
wait         wallpapers/  wapps        watchbm      
wall         wapi         watch        watchgnupg

% wat<Ctrl+D>
-- external command --
-- alias --
-- parameter --
watch       watchbm     watchgnup

The <Ctrl+X>? log file is quite long (3961 lines); I'm not sure how to make sense of it.

Best regards,
Peter


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