⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1066-1067.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:Special Files:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=04 //-->

<!-- PAGES=1063-1102 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="1063-1065.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1068-1069.html">Next</A></CENTER></P>







<A NAME="PAGENUM-1066"><P>Page 1066</P></A>





<P><B> ISO 2022 AND ISO 4873 </B></P>



<P>The ISO 2022 and 4873 standards describe a font-control model based on VT100 practice. This model is

(partially) supported by the Linux kernel and by

xterm(1). It is popular in Japan and Korea.

</P>



<P>There are four graphic character sets, called G0, G1, G2, and G3, and one of them is the current character set for codes

with high bit zero (initially G0), and one of them is the current character set for codes with high bit one (initially G1).

Each graphic character set has 94 or 96 characters, and is essentially a 7-bit character set. It uses codes either

040_0177 (041_0176) or 0240_0377 (0241_0376). G0 always has size 94 and uses codes

041_0176.

</P>



<P>Switching between character sets is done using the shift functions ^N

(SO or LS1), ^O (SI or LS0), ESC n (LS2), ESC o (LS3),

ESC N (SS2),

</P>



<P>ESC O (SS3), ESC ~ (LS1R), ESC } (LS2R), ESC |

(LS3R). The function LSn makes character set Gn the current one for codes

with high bit zero. The function LSnR makes character set

Gn the current one for codes with high bit one. The function

SSn makes character set Gn (n=2 or 3) the current one for the next character only (regardless of the value of its high order bit).

</P>



<P>A 94-character set is designated as Gn character set by an escape sequence

ESC ( xx (for G0), ESC ) xx (for G1), ESC * xx

(for G2), ESC + xx (for G3), where xx is a symbol or a pair of symbols found in the ISO 2375 International Register of

Coded Character Sets. For example, ESC ( @ selects the ISO 646 character set as G0,

ESC ( A selects the U.K. standard character set (with pound instead of number sign),

ESC ( B selects ASCII (with dollar instead of currency sign),

ESC ( M selects a character set for African languages,

ESC ( ! A selects the Cuban character set, and so on.

</P>



<P>A 96-character set is designated as Gn character set by an escape sequence

ESC - xx (for G1), ESC . xx (for G2) or ESC / xx (for G3). For example,

ESC - G selects the Hebrew alphabet as G1.

</P>



<P>A multibyte character set is designated as Gn character set by an escape

sequence ESC $ xx or ESC $ ( xx (for G0), ESC $ )

xx (for G1), ESC $ * xx (for G2), ESC $ + xx (for G3). For

example, ESC $ ( C selects the Korean character set for G0.

The Japanese character set selected by ESC $ B has a more recent version selected by

ESC &amp; @ESC $ B.

</P>



<P>ISO 4873 stipulates a narrower use of character sets, where G0 is fixed (always ASCII), so that G1, G2, and G3 can only

be invoked for codes with the high order bit set. In particular, ^N and ^O are not used anymore,

ESC ( xx can be used only with xx=B, and ESC ) xx, ESC

* xx, ESC + xx are equivalent to ESC - xx, ESC .

xx, and ESC / xx, respectively.

</P>



<P><B> SEE ALSO </B></P>





<!-- CODE SNIP //-->

<PRE>

console(4), console_ioctl(4), console_codes(4)

</PRE>

<!-- END CODE SNIP //-->



<P>Linux, 5 November 1996

</P>



<H3><A NAME="ch04_ 3">

console

</A></H3>



<P>console&#151;Console terminal and virtual consoles

</P>



<P><B> DESCRIPTION </B></P>



<P>A Linux system has up to 63 virtual consoles (character devices with major number 4 and minor number 1 to 63),

usually called /dev/ttyn with 1 n 63. The current console is also addressed by

/dev/console or /dev/tty0, the character device

with major number 4 and minor number 0. The device files

/dev/* are usually created using the script

MAKEDEV, or using mknod(1), usually with mode 0622 and owner

root.tty.

</P>



<P>Before kernel version 1.1.54, the number of virtual consoles was compiled into the kernel (in

tty.h: #define NR_CONSOLES 8) and could be changed by editing and recompiling because version 1.1.54 virtual consoles are created on-the-fly, as soon

as they are needed.

</P>



<P>Common ways to start a process on a console are the following:

</P>



<UL>

<LI>          Tell init(8) (in inittab(5)) to start a

getty(8) on the console



<LI>          Ask open(1) to start a process on the console



<LI>          Start X; it will find the first unused console and display its output there. (There is also the ancient

doshell(8).)

</UL>



<A NAME="PAGENUM-1067"><P>Page 1067</P></A>



<P>Common ways to switch consoles are the following:

</P>





<UL>

<LI>          Use Alt+Fn or Ctrl+Alt+Fn to switch to console n; AltGr+Fn might bring you to console n+12 [here Alt and AltGr

refer to the left and right Alt keys, respectively]

<LI>          Use Alt+RightArrow or Alt+LeftArrow to cycle through the presently allocated consoles

<LI>          Use the program chvt(1). (The key mapping can be set by the user; see

loadkeys(1); the preceding key combinations are according to the default settings.)

</UL>



<P>The command disalloc(8) will free the memory taken by the screen buffers for consoles that no longer have any

associated process.

</P>



<P><B>PROPERTIES</B></P>



<P>Consoles carry a lot of state. I hope to document that some other time. The most important fact is that the consoles

simulate vt100 terminals. In particular, a console is reset to the initial state by printing the two characters ESC c. All escape

sequences can be found in console codes(4).

</P>



<P><B> FILES </B></P>



<!-- CODE SNIP //-->

<PRE WIDTH="1">/dev/console

/dev/tty*

</PRE>

<!-- END CODE SNIP //-->



<P><B> SEE ALSO </B></P>



<!-- CODE SNIP //-->

<PRE>charsets(4), console_codes(4), console_ioctl(4),

mknod(1), tty(4), ttys(4), getty(8), init(8), chvt(1),

open(1), disalloc(8), loadkeys(1), resizecons(8),

setfont(8), mapscrn(8)

</PRE>

<!-- END CODE SNIP //-->





<P>Linux, 31 October 1994

</P>





<H3><A NAME="ch04_ 4">

console_codes

</A></H3>



<P>console_codes&#151;Linux console escape and control sequences

</P>



<P><B> DESCRIPTION </B></P>



<P>The Linux console implements a large subset of the VT102 and ECMA-48/ISO 6429/ANSI X3.64 terminal controls,

plus certain private-mode sequences for changing the color palette, character-set mapping, and so on. In the following

tabular descriptions, the second column gives ECMA-48 or DEC mnemonics (the latter if prefixed with DEC) for the

given function. Sequences without a mnemonic are neither ECMA-48 nor VT102.

</P>



<P>After all the normal output processing has been done, and a stream of characters arrives at the console driver for

actual printing, the first thing that happens is a translation from the code used for processing to the code used for printing.

</P>



<P>If the console is in UTF-8 mode, then the incoming bytes are first assembled into 16-bit Unicode codes. Otherwise,

each byte is transformed according to the current mapping table (which translates it to a Unicode value). (See the &quot;Character

Sets&quot; subsection for discussion.)

</P>



<P>In the normal case, the Unicode value is converted to a font index, and this is stored in video memory, so that the

corresponding glyph (as found in video ROM) appears on the screen. Note that the use of Unicode (and the design of the

PC hardware) allows the use of 512 different glyphs simultaneously.

</P>



<P>If the current Unicode value is a control character, or you are currently processing an escape sequence, the value will

treated specially. Instead of being turned into a font index and rendered as a glyph, it may trigger cursor movement or other

control functions. (See the &quot;Linux Console Controls&quot; subsection.)

</P>



<P>It is generally not good practice to hardwire terminal controls into programs. Linux supports a

terminfo(5) database of terminal capabilities. Rather than emitting console escape sequences by hand, you will almost always want to use a <BR>

terminfo-aware screen library or utility such as

ncurses(3), tput(1), or reset(1).

</P>







<P><CENTER>

<a href="1063-1065.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1068-1069.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -