Keep ZSH config when entering remote machine via ssh

Viewed 1063

I was wondering if there was a way to keep the formatting, functionality and aliases I've set up with ZSH locally whenever I enter a remote machine via SSH. Currently, as I would expect without any type of configuration, it defaults to a standard terminal.

I am on Ubuntu 19.10 running zsh 5.7.1 in the terminal application.

1 Answers

Please look at this repository:

https://github.com/romkatv/zsh4humans

It advertises itself with:

SSH

When you connect to a remote host over SSH, your local Zsh for Humans environment gets teleported over to it. The first login to a remote host may take some time. After that it's as fast as normal ssh.

Under the hood it is described to work like this:

  1. Archives Zsh config files on the local host and sends them to the remote host.
  2. Extracts Zsh config files on the remote host.
  3. Sources %U.zshenv%u with Z4H_BOOTSRAPING=%F{3}'1'%f, which starts the usual %Bzsh4humans%b bootstrap process.

Maybe this is not as specific answer that you would be happy with but you can dig there to find something useful.

Related