Rsync completion broken in zsh with config file
Asked Answered
O

0

1

I want to have my ssh|scp|rsync completion in zsh to only show me the the hosts defined in my .ssh/config file. I also want to avoid the autocompletion to show me any host or hostname with dots. I was almost able to achieve this with the following .zshrc

(just showing the relevant part of my .zshrc)

zstyle ':completion:*:(ssh|scp|rsync):*' ignored-patterns '*(.|:)*'
zstyle ':completion:*:(ssh|scp|rsync):*' hosts
zstyle ':completion:*:(ssh|scp|rsync):*' users                                                                                                        
 
autoload -Uz compinit  
compinit

and an example ssh/config file

Host myHost
    Hostname host.xxx.yyy.com
    User username

Host otherHost10 otherHost11 otherHost12
    Hostname %h.xxx.yyy.com
    User username
    ProxyJump myHost

Host some.host.with.dots
    User username

From this config file, I only want to see autocompletion for the first two entries and not the third one.

With .zshrc provided above, this works as expected for ssh and for scp, but the eutocompletion engine only shows local folders for rsync.

Any idea what is wrong?

Obau answered 10/3, 2023 at 11:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.