I want to start tmux with two panes and have one of them running a program:

[0] [ishpeck@kiyoshi ~]$ cat ~/.tmux.conf
split-window -h top
[0][ishpeck@kiyoshi ~]$ tmux

When tmux comes up, it displays the error:

/home/ishpeck/.tmux.conf:1: no current target

With tmux still open, I hit prefix then type ":source ~/.tmux.conf " and it works as expected. Why does it never work at start-up, but works fine when I'm sourcing it?


2 Answers 2


I figured out a solution that only involves tmux but still involves a second file.

In your tmux.conf add this line:

set-hook -g after-new-session "source-file /path/to/tmux-windows.conf"

Then put your windows and splits in that tmux-windows.conf file.


Having now looked at the code for tmux, it appears that the config file is read before there is any session. It's not a trivial to change that.

Based on the comments from Aulis Ronkainen, it looks like the best bet is to have a shell script that runs tmux commands.

See also: https://www.reddit.com/r/linuxquestions/comments/82yi3s/how_to_get_tmux_to_start_with_a_couple_of_split/

  • 1
    I'm glad you solved the issue. Good work! Mar 15, 2019 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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