Setting up tmux with z-shell (zsh) as default

tmux , I would say is one of the finest interface to work on a remote server. But it comes with a boring shell. This post will help you configure zsh as the default shell when logging into ​​tmux.

Step 1 : Install zsh

sudo apt-get update
sudo apt-get install zsh
# check `zsh` version.
# It is prefereable to use a version above 5.0
zsh --version

Step 2 : Install oh-my-zshell

# you may follow either line 3 or line 5
# installation using curl
sh -c "$(curl -fsSL"
# installation using wget
sh -c "$(wget -O -)"

Step 3 : update config file for tmux

# updating the config file for tmux to open with zsh
echo "set-option -g default-shell /bin/zsh" >> ~/.tmux.conf

Now kill all tmux sessions using killall tmux and restart using tmux. This shoudl start with zsh as default.

Step 4(optional) : Change default shell (outside tmux) back to bash

If you want to retain bash (or default shell outside tmux) change default login shell as follows:

# changing default shell to bash
chsh -s /bin/bash



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s