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

📄 ch05_07.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 5] 5.7 What termcap and terminfo Do and Don't Control </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:33:05Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch05_01.htm"TITLE="5. Setting Up Your Terminal"><LINKREL="prev"HREF="ch05_06.htm"TITLE="5.6 Checklist: Terminal Hangs When I Log In "><LINKREL="next"HREF="ch05_08.htm"TITLE="5.8 Terminal Escape Sequences "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch05_06.htm"TITLE="5.6 Checklist: Terminal Hangs When I Log In "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 5.6 Checklist: Terminal Hangs When I Log In "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 5<BR>Setting Up Your Terminal</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch05_08.htm"TITLE="5.8 Terminal Escape Sequences "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 5.8 Terminal Escape Sequences "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-0076">5.7 What termcap and terminfo Do and Don't Control </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-5268"></A><ACLASS="indexterm"NAME="AUTOID-5270"></A>One important point to realize about <EMCLASS="emphasis">termcap</EM> and <EMCLASS="emphasis">terminfo</EM>is that many programs do not use them at all, and that there are severalother mechanisms that may also affect terminal operation.</P><PCLASS="para">The operation of the serial interface is controlled by several systemfiles (<EMCLASS="emphasis">/etc/ttys</EM> and <EMCLASS="emphasis">/etc/gettytab</EM> on BSD and othernon-AT&amp;T systems, and <EMCLASS="emphasis">/etc/inittab</EM> and <EMCLASS="emphasis">/etc/gettydefs</EM> inSystem V). Users can affect serial-line parameters with the<SPANCLASS="link"><EMCLASS="emphasis">stty</EM> (<ACLASS="linkend"HREF="ch05_09.htm"TITLE="Setting Your Erase, Kill, and Interrupt Characters ">5.9</A>, <ACLASS="linkend"HREF="ch41_03.htm"TITLE="Find Out Terminal Settings with stty ">41.3</A>, <ACLASS="linkend"HREF="ch41_02.htm"TITLE="stty and All That Stuff ">41.2</A>)</SPAN>command.In addition to normal communications parameterssuch as data rate, start and stop bits, parity, and so on, theseparameters include such things as the translation of the carriagereturns generated by most terminals into the linefeeds expected bymost UNIX programs, division of input into lines, and definition ofspecial control characters for erasing a character that has beentyped, killing a line of typed input, and interrupting a runningprocess.</P><PCLASS="para">One other area that <EMCLASS="emphasis">termcap</EM> and <EMCLASS="emphasis">terminfo</EM> do not control isterminal tab setting. This is done by the <EMCLASS="emphasis">tabs</EM> command.For more information, see the manual pages on <EMCLASS="emphasis">stty</EM>(4) and <EMCLASS="emphasis">termio</EM>(7) (System V).</P><PCLASS="para"><EMCLASS="emphasis">termcap</EM> and <EMCLASS="emphasis">terminfo</EM>, by contrast, tend to control visualattributes of the terminal. The terminal capabilities defined for aterminal tell a screen-oriented program how big the screen is (forscreen-by-screen paging and cursor movement), how to move to any pointon the screen, how to refresh the screen, how to enter and exit anyspecial display modes (such as inverse video, blinking, orunderlining), and so on.[The screen size may be set in other ways, too.See article<ACLASS="xref"HREF="ch42_05.htm"TITLE="Checklist: Screen Size Messed Up? ">42.5</A>.<EMCLASS="emphasis">-JP</EM>&nbsp;]</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-5293"></A>But there is some overlap. For example, a terminal can be unusablebecause a program has left either the serial line modes or theterminal itself in an unexpected state. For this reason,<SPANCLASS="link">terminal initialization (<ACLASS="linkend"HREF="ch05_11.htm"TITLE="Initializing the Terminal with tset ">5.11</A>)</SPAN>,as performed by the <EMCLASS="emphasis">tset</EM> and <EMCLASS="emphasis">tput</EM> programs,initializes both theterminal and the serial line interface.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">TOR</SPAN> <SPANCLASS="bibliomisc">from O'Reilly &amp; Associates' <CITECLASS="citetitle">termcap &amp; terminfo</CITE>, Chapter 1</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch05_06.htm"TITLE="5.6 Checklist: Terminal Hangs When I Log In "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 5.6 Checklist: Terminal Hangs When I Log In "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch05_08.htm"TITLE="5.8 Terminal Escape Sequences "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 5.8 Terminal Escape Sequences "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">5.6 Checklist: Terminal Hangs When I Log In </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">5.8 Terminal Escape Sequences </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed &amp; awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>

⌨️ 快捷键说明

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