tmux

tmux #

Terminal Multiplexer.

Managing sessions #

Command
tmux new -s session_nameCreate a new session with the name session_name
C-b dDetach from the current session
tmux lsList all sessions
tmux attach -t session_nameAttach to a session with the name session_name
tmux kill-session -t session_nameKill a session with the name session_name
tmux kill-serverKill all the server and all tmux sessions

Managing windows #

Command
tmux new-window -n window_nameCreate a new window with the name window_name
C-b cCreate a new window
C-b wList all windows
C-b 0Switch to window 0
C-b nSwitch to the next window
C-b pSwitch to the previous window
tmux select-window -t window_nameSelect a window with the name window_name
C-b , or tmux rename-window new_window_nameRename the current window to new_window_name
C-b & or tmux kill-window -t window_nameKill a window with the name window_name

Managing panes #

Shortcut
C-b %Split the current pane vertically
C-b "Split the current pane horizontally
C-b qShow pane numbers. Type the number to switch to the pane.
C-b oSwitch to the next pane
C-b xKill the current pane
C-b zToggle pane zoom
C-b {Move the current pane to the left
C-b }Move the current pane to the right
C-b !Break the current pane into a new window

Tmux configurations in ~/.tmux.conf #

Configuration
set -g mouse onEnable mouse support
set -g history-limit 10000Set the history limit to 10000 lines

To reload the configuration file tmux source ~/.tmux.conf