Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
10  
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
1  
FWIW, you don't need to set default-command if you've set default-shell. –  Nicholas Riley Feb 29 '12 at 20:03

6 Answers 6

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

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

share|improve this answer
2  
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
12  
BTW: Restarting tmux means killall tmux; tmux. Took me quite a while to figure out. –  js-coder Dec 21 '12 at 14:48
3  
Configs could be reloaded without killing a server: bind R source-file ~/.tmux.conf \; display-message " Config reloaded..". –  ДМИТРИЙ МАЛИКОВ Jul 2 '13 at 8:01
    
Or simply run tmux source-file ~/.tmux.conf from the command line. –  Petr Pudlák Oct 29 at 12:43

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
    
tmux kill-server is the command to end all tmux servers –  Keith Smiley Oct 14 '13 at 17:05

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

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

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

Add this into your ~/.tmux.conf

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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