tmux linux is a kind of window management program, unlike iTerm2, it provides a ready Session storage and recovery of function (Session concept will be introduced later), detach Session (Session to keep running in the background) and then re-attach Session
Common scene in the company Terimal opened in multiple tabs and files home from work suddenly had inspiration want to continue to write, use ssh remote link to the company's computer, and then find the file tabs to be reopened, if Tmux, work detach the current Session, home ssh remote connection, after attach Session, the scene recovery can continue programming a pleasant ...
# Installation for Mac OS X lost package management Homebrew
$ Ruby -e "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install artifact Tmux
$ Brew install tmux
# Start Tmux
# Close Tmux
$ Ctrl + d
Or exit #
tmux There are three basic concepts: Session (Session), Window (Window) and panel (Pane) when you enter tmux, tmux actually do is to first create a session (Session), and then create a window in this session, you can continue to create more than one window (window), each window initially contains only one panel, continue after split-screen, there will be a plurality of panels (Pane) in which you can see the terminal actually belong to a panel of tmux
Still further, Session can contain multiple Window, each can contain multiple Pane Window
All shortcuts performed on:
Press control + b two key combination, then release the control + b (I want to tell Tmux Tmux shortcuts), then trigger various behaviors shortcut keys.
For example:? C-b is pressed during the execution of two key combination control + b, then release the control + b, then press the key, it will display a list of all shortcuts '?'.
C-b? Lists all the shortcuts, press q or Esc to return
C-b d detach the current session, it can temporarily return to Shell interface, enter before tmux attach to re-enter the session
Used in multiple sessions open simultaneously; C-b s choice and switch sessions
C-b c create a new window
C-b & Close the current window
C-b w List all window selection
C-b p to switch to the previous window
C-b n to switch to the next window
C-b Number window switch windows using the window number (such as window number 1, then C-b 1)
C-b, rename the current window for easy identification of each window
C-b% Horizontally Terminal
C-b "Vertically Terminal
C-b is the free choice of the direction keys to each of the panel
C-b x to close the current pane
C-b q display panel No.
# Create a new session
$ Tmux new-s
# Create a new Session at the current session, the session still exists and to ensure that before
# C-b: and then enter the following command
# Enter the named test session
$ Tmux attach -t test
C-b s lists all the sessions
C-b d detach the current session (that it runs in the background)
Use gpakosz of Tmux configuration landscaping.
Use C-a as a prefix easier to use, while preserving the C-b triggering prefix
powerline status bar beautification (vim are used should be familiar)
Laptop battery status display
$ Rm -rf .tmux
$ Git clone https://github.com/gpakosz/.tmux.git
$ Ln -s .tmux / .tmux.conf
$ Cp .tmux / .tmux.conf.local.