Guide · ssh
ssh host autocomplete in zsh, from your ssh config and known_hosts
Last checked 19 November 2026
In short: type ssh and Termhint's popup lists the hosts you set up in ~/.ssh/config, then the ones in ~/.ssh/known_hosts. Type deploy@ first and the user stays in front of each host. The files are read on your Mac; nothing about your hosts leaves it.
Where hosts show up
ssh,scp,sftp,rsyncandmosh, wherever their completion spec expects a host.- After
user@.ssh deploy@proffersdeploy@prod-web: the user you typed is kept and the host completes. - Config hosts first. The hosts you named on purpose read "Host in ssh config" and come before the rest; names that only appear in
known_hostsread "Known host". A name in both shows once.
An example
With this ~/.ssh/config:
Host prod-web
HostName 203.0.113.10
User deploy
Host staging-db
HostName 203.0.113.20
Host *
ServerAliveInterval 60
and a known_hosts that also lists git.example.com, the popup lists:
$ ssh
prod-web Host in ssh config
staging-db Host in ssh config
git.example.com Known host
$ ssh deploy@
deploy@prod-web Host in ssh config
deploy@staging-db Host in ssh config
deploy@git.example.com Known host
Host * is a pattern, not a host you can log into, so it is left out.
What is read, and what is skipped
~/.ssh/configand every file itIncludes: paths starting with~/, paths relative to~/.ssh, and globs such asconfig.d/*, expanded in order as ssh does.- Only plain names from
Hostlines. Patterns with*or?, negations with!and names with a port are skipped. ~/.ssh/known_hosts: the plain names at the start of each line. Hashed entries (|1|…, written whenHashKnownHostsis on) can't be turned back into names;[host]:portentries need-pand are left out;@cert-authorityand@revokedlines name no host to log into.- Nothing else. Private keys, the agent and other files in
~/.sshare not opened.
Read on your Mac, never by running ssh
Fig's ssh completions ran cat on these files. Termhint reads them itself, only when they are regular files under a size limit, and keeps the list until one of the files changes, so a keystroke costs a few file checks. It never starts ssh to build the list.
The hosts stay in memory on your Mac and are never sent anywhere. The ranking Termhint learns from what you run keeps only command, subcommand and option names, never arguments such as hosts. The app goes online only for what the privacy policy lists (license, updates, and downloads you ask for).
Where it works
Termhint is a Mac app (macOS 14 or later, Apple silicon) for zsh. The popup shows in the terminals on the terminals page, and inside tmux, its split panes too. Beyond hosts it completes subcommands and options for 3,272 commands (zsh autocomplete), git branches, Docker containers and images and Makefile targets.
FAQ
Which commands get ssh host suggestions?
ssh, scp, sftp, rsync and mosh, wherever their completion spec expects a host. Typing a user and @ first keeps the user: ssh deploy@ lists deploy@prod-web and the other hosts.
Does Termhint read my ssh keys or send my hosts anywhere?
No. It reads only ~/.ssh/config, the files that config includes, and ~/.ssh/known_hosts, on your Mac. The host names stay in memory there; they are never sent, and the ranking Termhint learns never keeps them.
Why doesn't a host from known_hosts show up?
Hashed entries (lines starting with |1|, written when HashKnownHosts is on) can't be read back into names, and entries with a port, such as [example.com]:2222, are left out because they need -p. Add the host to ~/.ssh/config to have it listed.
Does Termhint run ssh to find hosts?
No. It reads the files itself and keeps what it read until one of them changes. It never starts ssh for the list.
What it costs
Every feature works for 7 days with no account and no card. After that, a one-time license: $11.99 for 1 Mac, $19.99 for 3, $29.99 for 5, plus VAT or sales tax where it applies (pricing).