tmux: Quick Start - Split Terminal Vertically & Horizontally

In this post, I am going to split terminal windows on mac using tmux.


what is tmux?

"tmux is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached" (man page)


install

% brew install tmux

% tmux -V

tmux 3.2


start session

% tmux

% tmux ls

0: 1 windows (created Sun Apr 25 20:14:43 2021) (attached)



Ctrl-b

Ctrl-b is the signal to use tmux commands. Typing a key followed by Ctrl-b lets you split the pane, kill the window, etc.

Here is the snippet from the mannual:

DEFAULT KEY BINDINGS

     tmux may be controlled from an attached client by using a key combination of a prefix key, `C-b' (Ctrl-b) by default, followed by a command key.


           C-b         Send the prefix key (C-b) through to the application.

           "           Split the current pane into two, top and bottom.

           %           Split the current pane into two, left and right.

           o           Select the next pane in the current window.


split pane

1. Split the pane vertically.

Ctrl+b %


2. Split the pane horizontally.

Ctrl+b "


3. Switch to the next pane.

Ctrl+b o


4. Close the current pane.

exit

Keep exiting to kill the session.


Comments

Popular posts from this blog

Minikube Installation for M1 Mac

Selenide: Quick Start

Ansistrano (Ansible + Capistrano): Quick Start