6

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

  • 2
    According to 2) tmux is using Zsh as your shell. What is your issue? – jasonwryan Jul 5 '15 at 23:49
  • Sorry, I should have included that executing ps -p $$ in tmux prints: 20201 ttys001 0:00.02 -bash. Even though the $SHELL variable seems to be set, tmux doesn't actually seem to be using zsh. Also, on this machine powerline's only been configured for bash. Every time I start tmux, powerline's definitely visible. – Justian Meyer Jul 6 '15 at 1:43
10

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.

  • 1
    This still doesn't seem to solve the issue. – Justian Meyer Jul 8 '15 at 5:09
  • @JustianMeyer: Can you show me your .tmux.conf? – cuonglm Jul 8 '15 at 5:12
  • @JustianMeyer Did you restart tmux with killall tmux; tmux command? – MOHRE Jul 18 '17 at 6:46
1

On top of what @cuonglm said, check for references to bash in your .tmux.conf.

For example, I was using a typical integration for copying & pasting in iTerm on Mac:

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

... which, to function properly with zsh had to be changed to:

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.