Configure tmux to use zsh

environment-variablesitermtmuxzsh

Right now I have my iTerm session configured to use zsh (/usr/local/bin/zsh), but I'm trying to configure tmux to use zsh as well, instead of /bin/bash/, which it's currently defaulting to. So far nothing I've read up on has gotten me where I need. Any ideas or things I may have missed?

Below are some details about my current setup. Thanks!

Check state:

1) Open iTerm

echo $SHELL

/bin/bash

ps -p $$

PID TTY TIME CMD
19626 ttys000 0:00.52 /usr/local/bin/zsh

2) Run tmux

tmux

echo $SHELL

/usr/local/bin/zsh

Configuration:

iTerm Profiles > General > Command:

/usr/local/bin/zsh

In .tmux.conf:

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

Best Answer

You need to set default-command:

set -g default-command /usr/local/bin/zsh

default-shell variable only use to create a login shell, when default-command is empty - which is default value.

Or you can simply change your default shell to zsh, in this case, tmux will start a login shell, instead of non-login shell.

Related Question