Wednesday 1 July 2015

Using tmux to split terminal windows

Before using tmux, it was very common that I had 5 or 6 terminal windows open (I don't like using tabs). This made it very hard to navigate between each window, especially since I only have two small screens.  Having other programs like Firefox open just added to the clutter.  With tmux I can lower the amount of windows to just 1 or 2, and that is done by splitting the windows.

I find having multiple panes in a window is very useful for having one dedicated to writing code, another for running code, and a third for processes.  You may find different combinations which work best for you.  Typically I have one pane no the top half and the bottom half is split into two panes side by side.

Tmux has a lot of features besides splitting windows, but this tutorial just looks at the splitting windows feature.

Useful commands
ctrl-b " - split horizontally
ctrl-b % - split vertically
ctrl-b x - close pane
ctrl-b <arrow key> - navigate between panes.

1. Split horizontally
ctrl-b "

2. Split vertically
ctrl-b %

3. Split into three
 ctrl-b "
To get a split row on the bottom, navigate to the bottom pane and do
ctrl-b %
The process is similar for if you want to split the top row.

No comments:

Post a Comment