So after you have learned how to add windows and split your windows into panes you exit and start all over again the next time you start tmux in a terminal.
That is what we have the ~/.tmux.conf file for! To open what we like every time so I happily enter the following:
Code: Select all
new -s berserk -n berserk
split-window htop
split-window
clock-mode
setw main-pane-width 55
select-layout -t 0 main-vertical
selectp -t 0
That should split my berserk window in three with a clock and htop to the right.
So I happily dance away to the CLI and start tmux and..... Nothing Simply one newly created window and that is it.
Here is the trick:
You need to start tmux like this to load the config file:
Code: Select all
tmux attach
And life is good
If you end your session with CTRL+b and d (for detach) the last state of your tmux will be loaded the next time you start it with
Code: Select all
tmux attach
I switch between the panes with CTRL+b and o
You will get a list with CTRL+b and ? (Hold down CTRL+b and let go - then press ? within 10 sec)
Set it up to your liking and when everything is perfect do a CTRL+b and d and then add this line to your ~/.bashrc
Code: Select all
[[ $TERM != "screen" ]] && tmux attach && exit
After that the terminal pops up exactly as you left it. If you have sudo iftop running in one pane it will remember the sudo too.
To resize the panes you can hold down CTRL+b and press Left Arrow or right Arrow