Tab completion for hosts defined in ~/.ssh/config doesn't work anymore on Yosemite I'm trying to create my ~/.ssh/config file for simplify my work life on the server connection.

In Mavericks all worked properly and with the tab I was be able to autocomplete the hostname with file like this:

Host test-host-name
    HostName 192.168.1.2
    User root


The same configuration on Yosemite have a different behavior. When I type ssh t on the shell the tab does not autocomplete the hostname.

Do someone know if is something changed in Yosemite and now I need to do something to make it work?
You can enable bash shell completion by installing bash-completion via brew:

brew install bash-completion


Then add the following to your ~/.bash_profile:

if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi


Source

(Edit: brew tap homebrew/completions is deprecated as of 2018.)