Published on

Set default shell to zsh in Tmux

Set default shell to zsh in Tmux

Tmux is one of the most useful tool when it comes to using using a linux terminal.

Tmux is a terminal multiplexer, it allows a user to access multiple terminals (or windows), each running a separate program, while providing a single screen to work on. Tmux is useful for running more than one command-line program at the same time, increasing productivity and the way you work.

Tmux is one of the "terminal multiplexer", it enables a number of terminals (or windows) to be accessed and controlled from a single terminal. It allows you to create a session on a remote box, run applications in that remote session, "detach" from the session, and re-"attach" when desired. It also has advanced features such as multiple windows and split views. Using tmux is recommend when running an interactive CLI program remotely. If you get disconnected from your session, you can re-attach as though nothing happened.

Setting zsh as default shell for tmux

Setting default shell is easy and can be done using the default-shell command. It's better to set it in the global ~/.tmux.conf.

set -g default-shell /bin/zsh

You have to reload changes in tmux config tmux.conf so that it reflects-

tmux source-file ~/.tmux.conf

You will have to kill your existing tmux sessions to make sure it reflects.

killall tmux

If the above doesn't help, use htop to find all processes named tmux and kill them all using the following command-

kill -9 <processid>

or if you need sudo privileges to kill,

sudo kill -9 <processid>

You can also set the default shell to bash, check this article.

I hope you found this article useful, glad that you found it easy to set default shell to zsh in Tmux.