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.

I just installed tmux on Ubuntu 10.04 and tried to remap the prefix key to C-a by creating the file ~/.tmux.conf with these lines:

set-option -g prefix C-a
unbind-key C-b

When starting tmux, both regularly and with -f ~/.tmux.conf, the prefix is effectively the same default C-b

There are no errors or warnings whatsoever.

Any idea what's wrong with the loading of the conf?

share|improve this question
    
It Works For Me™. Try running strace -s9999 -f -o tmux.strace tmux -c true and post the output of grep -C5 'tmux\.conf' tmux.strace. –  Gilles Sep 14 '10 at 20:24
    
I had this same problem, no existing sessions, ('tmux ls' reported connection refused, i.e. not running), but it still wasn't reading the conf file. I was launching it with a CWD somewhere in /usr, but when I switched to ~/ and launched tmux, it processed the conf file. It's weird behaviour, but that's something to check. –  Ranko Kohime Jan 26 '13 at 21:30
add comment

4 Answers

The file ~/.tmux.conf is loaded when the tmux server is first started. So if there are existing tmux sessions, starting a new session with tmux does not result in reloading the conf file. Try restarting tmux server: Use the command tmux list-sessions to see if there are existing sessions. Exit them (e.g. tmux reattach then kill all windows and exit). Once all sessions are gone, try tmux again. This time the rebinding should work.

share|improve this answer
11  
killall tmux or tmux kill-server will get the job done too –  Matt Jun 25 '11 at 2:01
add comment

To reload your ~/.tmux.conf without killing your session, you can simply do:

C-b :source-file /absolute/path/to/your/.tmux.conf
share|improve this answer
add comment

run inside your tmux session:

tmux source-file /absolute/path/to/your/.tmux.conf
share|improve this answer
add comment

There's also a default keyboard shortcut binding to reload your ~/.tmux.conf, at least in my installation: C-b r. If you hit C-b ? it brings up a list of all bound keyboard shortcuts, so you can see if you have one already defined.

share|improve this answer
    
That is specific to your installation/configuration. By default, <prefix> r is bound to refresh-client (what you describe would be something like source ~/.tmux.conf). –  Chris Johnsen Jan 1 '12 at 3:09
add comment

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.