mac autocomplete for ssh hosts in terminal

Viewed 1450

I had used Ubuntu for a while and I have configured ssh aliases for hosts I need to connect through ssh. A few days ago I started using mac book and I moved all ssh info (keys, config) onto my mac. But when I'm typing ssh project_ and press TAB it does not show possible hostnames, and even when I'm typing ssh project_sta and TAB, autocompletion not working. But when I'm typing the full name like ssh project_staging it works, so I assume that everything is okay with the config file

I tried to use the original mac terminal and iterm2, same issue on both. Also, I asked other guys who work on mac, and ssh autocompletion works for them.

My ssh config:

Host project_staging
        HostName xxxxx
        User xxxx
        Port xxxx

Host project_production
        HostName xxxx
        User xxxxx
        Port xxxx

In real life, I have much more hosts and it's hard to remember all of them.

Any ideas, thank you!

1 Answers

okay, I solve it by adding zsh with oh_my_zsh and add ssh as a plugin to a .zshrc file

Related