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

Re: ".."+Tab (and "."+Tab) does not add "/" on MacOS (Sonoma)



On Wed, Jul 31, 2024 at 3:40 AM Philippe Altherr
<philippe.altherr@xxxxxxxxx> wrote:
>
> zstyle ':completion:*' special-dirs true;
>
> Thanks to that "cd ..."+Tab (and "cd ."+Tab) adds "/". I also noticed that "<any-path>/.."+Tab (and "<any-path>/."+Tab) adds "/" but for some reason, just ".."+Tab (and just "."+Tab) does NOT add "/". Any idea how that could be fixed?

Just noting that you seem to have contradictory statements there?
>> (and "cd ."+Tab) adds "/"
>> (and just "."+Tab) does NOT

Or does the second one mean trying to complete a command name rather
than a chdir target?

Anyway all of this works for me, e.g.:
schaefer<504> .[TAB]
Completing external command
.turd_MacPorts
Completing builtin command
.
Completing parameter
.zle.esc       .zle.sgr       .shadow.depth  .shadow.stack
Completing local directory
.git/               ../                 ./

(The last two do not appear with special-dirs false)

So I would suggest you look at _complete_help (^Xh) or _complete_debug
(^X?) output to try to find the failure.  ^Xh for me with "." in
command position as above (gmail may wrap lines):
tags in context :completion::complete:-command-::
    commands builtins functions suffix-aliases reserved-words jobs
parameters parameters aliases  (_command_names _autocd)
    commands
                           (_path_commands _command_names _autocd)
    path-dirs
                           (_path_commands _command_names _autocd)
    jobs
                           (_jobs _command_names _autocd)
    parameters
                           (_parameters _command_names _autocd)
    local-directories
                           (_cd _autocd)




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