Q: tmux exits with [exited] on mac os x I just installed tmux (a terminal multiplexer) with homebrew. When I try to run it, it always exits with [exited] Nothing shows up.  
When I try to run tmux list-session I get an error: 

failed to connect to server: Connection refused

I tried running tmux start-server, but again nothing happens.
What can I do?

A: In my situation I had been fiddling with a number of dotfiles so expected things to be amiss. My fix happened to be shutting down tmux with killall tmux. After this I was able to spin up properly.

A: Do make sure that the default-shell option only contains the executable path and does not contain options.
In /etc/tmux.conf or ~/.tmux.conf
set-option -g default-shell "/bin/bash"
set-option -g default-command "bash -l"
set-option -g default-path $HOME
set-option -g default-terminal "screen-256color"

A: This happened to me just after updating tmux, while I still had an old version of tmux running.
If you've just updated tmux, quit all the running tmux sessions and it should work again.

A: I had this same problem. It was caused by having set-option -g default-command "reattach-to-user-namespace -l zsh" in my .tmux.conf without having reattach-to-user-namespace installed.
The fix was to install "reattach-to-user-namespace" via Homebrew (brew install reattach-to-user-namespace)

A: If you're using a script to wrap reattach-to-user-namespace, as outlined by jimeh, don't forget to make the script executable with chmod +x ~/bin/login-shell.
