1.This chapter discusses what is required to provider a command line environment,
and then walks you through the terminal emulation packages you may run into
in the various Linux distributions.
2.A dumb terminal was usually nothing more than a monitor and keyboard connected
to the Unix system via a communication cable(usually a multi-wire serial cable).
3.One way to get to a CLI is to take the Linux system out of graphical desktop
mode and place it in text mode. This mode is called the Linux console
because it emulates the old days of a hard-wired console terminal and is a
direct interface to the Linux system.
4.The alternative to being in the Linux console is to use a terminal emulation
package from within the graphical desktop environment.
5.Each terminal emulation package has the ability to emulate one or more specific
types of dumb terminals. If you are going to work with the shell in Linux,
unfortunately you'll need to know a little bit about terminal emulation.
6.A control code is a special code not used in the character set, which signals the
terminal to perform a special, nonprintable operation.
7.The terminfo database is a set of files that identity the characteristics of various
terminals that can be used on the Linux system.
8.The Linux system stores the terminfo data for each terminal type as a separate file in
the terminfo database directory. Some common locations are /etc/terminfo,
/lib/terminfo, and /usr/share/terminal.
For example: in Ubuntu, by default, ncurses will search /etc/terminfo first, then
/lib/terminal, then /usr/share/terminfo.
9.An individual terminfo file is a binary file that is the result of compiling a text file.
This text files contains code words that define screen functions, associated with the
control code required to implement the function on the terminal. we can use the
infocmp command to convert the binary entries into text.
digdeep@ubuntu:/lib/terminfo/l$ infocmp linux
# Reconstructed via infocmp from file: /lib/terminfo/l/linux
linux|linux console,
am, bce, ccc, eo, mir, msgr, xenl, xon,
colors#8, it#8, ncv#18, pairs#64,
... ...
10.The Linux shell uses the TERM environment variable to define which terminal
emulation setting in the terminfo database to use for a specific session.
When the TERM environment variable is set to xterm, the shell knows to use the
control codes associated with the xterm terminfo database entry for sending control
codes to the terminal emulator. To see the TERM environment variable, you can
just echo if from the CLI:
digdeep@ubuntu:/lib/terminfo/x$ echo $TERM
xterm
This example shows that the current terminal type is set to the xterm entry in the
terminfo database.
11.The Linux Console
In the early days of Linux, when you booted up your system you would see a login
prompt on your monitor, and that's all, that is called the Linux console. For example
in Ubuntu, we can use Ctrl + Alt + F1(or F2, F3, F4, F5, F6) to enter the Linux
Console. And use Ctrl + Alt + F7 back to the Graphics environment.
With modern Linux systems, when the Linux system starts it automatically creates
several virtual consoles.
12.The xterm Terminal
The oldest and most basic of X Window terminal emulation packages is xterm. The
xterm packages has been around since the original days of X Window, and is
included by default in most X Windows packages.
阅读(731) | 评论(0) | 转发(0) |