1

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?

1

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/

  • I'm glad you solved the issue. Good work! – Aulis Ronkainen Mar 15 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.