I have only these 2 lines in ~/.tmux.conf:
unbind r
bind r source-file ~/.tmux.conf; display "Reloaded"
I start up tmux with just
tmux
And
/Users/.../.tmux.conf:2: can't establish current session
is the result.
Why is this, and how can I prevent it?
You have a typo in the second command; you need to escape the semicolon. See the example in man tmux
:
bind-key R source-file ~/.tmux.conf \; \
display-message "source-file done"
As the manual goes on to explain:
Multiple commands may be specified together as part of a command sequence. Each command should be separated by spaces and a semicolon; commands are executed sequentially from left to right and lines ending with a backslash continue on to the next line, except when escaped by another backslash. A literal semicolon may be included by escaping it with a backslash (for example, when specifying a command sequence to bind-key).
I just had this error message when I had a few set
commands in there which didn't have the -g
flag. So if someone has that problem, try adding -g
to your set
s.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With