4

I've just started using mosh and I'm left thinking to myself "why didn't I start using this like two years ago?"

I'm even more impressed by the fact that it reads my ~/.ssh/config and respects the aliases in it. The only thing I'd like now is for tab completion on the aliases, like ssh does. Is there a way?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
bitofagoob
  • 1,335
  • 2
  • 15
  • 24

2 Answers2

2

zsh has great autocomplete functionality. Install zsh and make sure completion is setup (instructions here). The parts related to ssh you want in your .zshrc:

zstyle ':completion:*:ssh:*' hosts
compdef mosh=ssh

The first line will allow you to use allow tab completion of host names in response to ssh. The second line extend the same hostname extensions to mosh as well

Kelly Trinh
  • 191
  • 7
0

I've added some .bash_aliases to log into my various systems:

alias mj='mosh j3710'
alias m3='mosh 3770k'
etc.
etc.

I tried adding them to /etc/hosts but it didn't work. I'm sure there's probably a neater way of doing it but if nothing is suggested within the next couple of days I'll mark this as answered.

bitofagoob
  • 1,335
  • 2
  • 15
  • 24