Linux manual installation of TMUX compilation and problems encountered, linuxtmux
When you use a Linux terminal to execute command operations, you will often press Ctrl + Alt + t to open multiple labels for different operations. If you need to follow the execution results of another operation while executing one operation. After the operation is completed, a dialog box is displayed? After a sound prompt is sent, is the operation completed? These methods have been used. The trouble is to jump between different labels. In addition, if there are multiple labels, it is easy to forget which label is used.Google found a tool named tmux. After installation, the trial effect is as follows (three windows are divided ):
Compile and install the environment: Redhat 5.x/CentOS 5.x1, libevent1.4.x or libevent2.0.x has been installed in the default system path. Git clone git: // git.code.sf.net/p/tmux/tmux-code tmux
Cd tmux
Sh autogen. sh
./Configure & make
2. libevent is not installed. 1) download libeventsource code compilation and installation from http://libevent.org/( ROOT permission is required for installation to the default system path ).. /Configure & make
Make install2) Source tmux source code compilation and installation. Git clone git: // git.code.sf.net/p/tmux/tmux-code tmux
Cd tmux
Sh autogen. sh
./Configure & make
3. You have installed libevent in a custom path. Git clone git: // git.code.sf.net/p/tmux/tmux-code tmux
Cd tmux
Sh autogen. sh
DIR =/home/nieyong/local/libevent-2.0.11-stable
./Configure CFLAGS = "-I $ DIR/include" LDFLAGS = "-L $ DIR/lib"
Make
Errors:
1. Possible Errors During tmux Compilation
control.c: In function ‘control_callback’:control.c:63: warning: implicit declaration of function ‘evbuffer_readln’control.c:63: error: ‘EVBUFFER_EOL_LF’ undeclared (first use in this function)control.c:63: error: (Each undeclared identifier is reported only oncecontrol.c:63: error: for each function it appears in.)control.c:63: warning: assignment makes pointer from integer without a castmake: *** [control.o] Error 1
Because the libevent version used is too low, tmux1.8 requires libevent> = 2.0.10-stable
2. Possible errors when running tmux
tmux: error while loading shared libraries: libevent-2.0.so.5: cannot open shared object file: No such file or directory
Solution: Create a symbol link
32bit System
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5
64bit System
ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib64/libevent-2.0.so.5
Some commands:
Press CTRL-B c
This will create a new window and move the cursor of the screen to it. Now you can run your new application in the new window. You can modify the name of your current window. In the current example, the top program I run, so top is the name of the window.
If you want to rename, you only need to press:
CTRL-B
The status bar changes. You can rename the current window.
Once multiple windows are created in one session, we need to move them between these windows. Windows are organized together like arrays. Each window is marked with numbers starting from 0 and you want to quickly jump to other windows:
CTRL-B <window number>
If we name the window, we can use the following command to find them:
CTRL-B f
You can also list all windows:
CTRL-B w
Switch to different windows in sequence:
CTRL-B n (to the next window) CTRL-B p (to the previous window)
To exit a window, enter exit or:
CTRL-B &
Before closing the window, you need to confirm.
Divide windows into multiple panels
Sometimes you need to view the log file while working in the editor. Tracking logs while editing is really helpful. Tmux allows us to divide the window into multiple panels. For example, we can create a console to monitor our server and construct a complex development environment with the editor so that compilation and debugging can be performed at the same time.
Let's create another Tmux session and let it work as a panel. First, if we are in a session, we will be separated from the Tmux session:
CTRL-B d
Start a new session called "panes:
$ tmux new -s panes
You can split a window horizontally or vertically and horizontally split the input:
CRTL-B"
Now you have two panels. Now we split them vertically:
CRTL-B %
Added two more:
Move between them:
CTRL-B <cursor key>
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.