How can I make tmux use my default shell?

Solution 1:

set-option -g default-shell /bin/zsh

in ~/.tmux.conf or /etc/tmux.conf. Works on Fedora.

You can reload the config with <leader>: source-file <conf file> e.g.

<C-b>: source-file ~/.tmux.conf

You would need to do it for every tmux instance. Otherwise you may restart tmux with killall tmux; tmux

Solution 2:

First, ensure your default shell is set properly to zsh by running this in your command line:

chsh -s $(`which zsh`) $USER

Placing the following in your ~/.tmux.conf is a more robust option for any shell.

set-option -g default-shell $SHELL

Solution 3:

For MacOS users, drop this line in the bottom of your ~/.tmux.conf

set-option -g default-command "reattach-to-user-namespace -l zsh"

After you add that, kill and restart your tmux server and all should work.