Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a new setup, tmux is using bash instead of my default (zsh).

How can I force it to use zsh?

share|improve this question
11  
figured it out. Can set the following in tmux config: set -g default-command /bin/zsh set -g default-shell /bin/zsh – re5et Mar 6 '11 at 5:33
    
Thank you for posting the solution. This helped me. – Amjith Aug 2 '11 at 4:37
2  
FWIW, you don't need to set default-command if you've set default-shell. – Nicholas Riley Feb 29 '12 at 20:03
set-option -g default-shell /bin/zsh

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

You may have to restart tmux with killall tmux; tmux

share|improve this answer
3  
If this doesn't work for you then make sure you've restart tmux. Seems obvious but took me a good hour to figure out! – Andy Smith Sep 20 '12 at 20:55
17  
BTW: Restarting tmux means killall tmux; tmux. Took me quite a while to figure out. – js-coder Dec 21 '12 at 14:48
4  
Configs could be reloaded without killing a server: bind R source-file ~/.tmux.conf \; display-message " Config reloaded..". – ДМИТРИЙ МАЛИКОВ Jul 2 '13 at 8:01
1  
Or simply run tmux source-file ~/.tmux.conf from the command line. – Petr Pudlák Oct 29 '14 at 12:43
1  
@js-coder: to more cleanly kill your tmux server I'd recommend tmux kill-server instead. – Chuim Feb 13 '15 at 22:32

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

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

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

set-option -g default-shell $SHELL
share|improve this answer

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.

share|improve this answer
2  
Er, is there any indication that re5et (the OP) is on a Mac, or has that wrapper program installed? – Chris Johnsen Feb 1 '12 at 7:13
    
I think this answer only works for Mac OS X – EhevuTov Jul 25 '13 at 6:29
2  
tmux kill-server is the command to end all tmux servers – Keith Smiley Oct 14 '13 at 17:05
    
Although it wasn't the answer the OP asked for, I ended up in this thread and indeed I am on OS X, using this wrapper, and this is the solution I needed; so Thank You! – Jose Alban Sep 24 '15 at 11:47
    
how does this differ from set-option -g default-shell ? the above does not seem to work with the Fish shell. – Tommy Feb 9 at 1:50

Use chsh(1):

chsh -s /bin/zsh $USER
share|improve this answer
1  
i already had this set, but tmux was ignoring it. – re5et Mar 6 '11 at 5:33

Add this into your ~/.tmux.conf

set -g default-command /usr/local/bin/fish
share|improve this answer

Log-out and log-in again fixed my problem. When echoed $SHELL it was still /bin/bash but after log-out it was changed to /usr/bin/zsh

share|improve this answer

tmux appears to use the SHELL environment variable, so the following should work:

SHELL=/usr/bin/zsh tmux
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .