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

📄 tset.1

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 1
字号:
.\" SCCSID: @(#)tset.1	2.1	3/5/87.TH tset 1.SH Nametset \- set terminal mode.SH Syntax.B tset[\|\fIoptions\fR\|] [\fB\-m\fR\|[\fIident\fR\|][\fItest baudrate\fR\|]:type] \&... [ type ].br.B reset\&....SH Description.NXR "tset command".NXA "tset command" "term command".NXA "stty command" "tset command".NXR "terminal" "setting"The.PN tsetcommandsets up your terminal when you first log in to a UNIX system.It does terminal dependent processing such as settingerase and kill characters, setting or resetting delays,sending any sequences needed to properly initialized the terminal,and the like.It first determines the.I typeof terminal involved,and then does necessary initializations and mode settings.The type of terminal attachedto each \s-2UNIX\s0 port is specified in the /etc/ttys database.Type names for terminals may be found in the .MS termcap 5 database.If a port is not wired permanently to a specific terminal(not hardwired)it is given an appropriate generic identifier such as.IR dialup ..PPIn the case where no arguments are specified,.PN tsetsimply reads the terminal type out of the environment variable TERMand re-initializes the terminal.  The rest of this manual concernsitself with mode and environment initialization,typically done once at login, and optionsused at initialization time to determine the terminal type and set upterminal modes..PPWhen used in a startup script (.profile for .MS sh 1users or .login for .MS csh 1users)it is desirable to give information about the type of terminalyou will usually use on ports which are not hardwired.These ports are identified in .PN /etc/ttysas.I dialupor.I plugboardor.I arpanet.To specifywhat terminal type you usually use on these ports, the.B \-m(map) option flag is followed by the appropriate port type identifier,an optional baud rate specification,and the terminal type.(The effect is to ``map'' from some conditions to a terminal type,that is, to tell.PN tset``If I'm on this kind of port,guess that I'm on that kind of terminal''.)If more than one mapping is specified, the first applicable mapping prevails.A missing port type identifier matches all identifiers.Any of the alternate generic names given in.PN termcapmay be used for the identifier..PPA.I baudrateis specified as with .MS stty 1 ,and is compared with thespeed of the diagnostic output (which should be the control terminal).The baud rate.B testmay be any combination of:.BR > ,.BR @ ,.BR < ,and.BR ! ;.B @means ``at''and.B !inverts the sense of the test.To avoid problems with metacharacters, itis best to place the entire argument to.B \-mwithin ``\''' characters; users of .MS csh 1 must also put a ``\e'' before any ``!'' used here.Thus.EX 0tset \\-m \'dialup>300:adm3a\' \-m dialup:dw2 \-m \'plugboard:?adm3a\'.EE.PPcauses the terminal type to be set to an.I adm3aif the port in use is a dialup at a speed greater than 300 baud;to a .I dw2if the port is (otherwise) a dialup (that is, at 300 baud or less).(The examples given here appear to take up more thanone line, for text processing reasons.  When you type in real.PN tsetcommands, you must enter them entirely on one line.)If the.I typefinally determined by.PN tsetbegins with a question mark,the user is asked if he really wants that type.A null response means to use that type;otherwise, another type can be entered which is used instead.Thus, in the above case, the user is queried on a plugboard portas to whether they are actually using an.IR adm3a ..PPIf no mapping applies and a final.I typeoption, not preceded by a.BR \-m ,is given on the command linethen that type is used;otherwise the identifier found in the .PN /etc/ttysdatabase is assumed to be the terminal type.This should always be the case for hardwired ports..PPIt is usually desirable to return the terminal type,as finally determined by.PN tset ,and information about the terminal's capabilitiesto a shell's environment.  This can be done using the.B \-option; using the Bourne shell, .MS sh 1.EX 0 export TERM; TERM=\`tset \- options...`.EE.PPOr using the C shell,.MS csh 1.EX 0setenv TERM \`tset - options...`.EE.PPWith.PN cshit is convenient to make an alias in your .cshrc:.EX 0alias tset \'setenv TERM \`tset \- \e!*\`\'.EE.PPEither of these aliases allow the command.EX 0tset 2621.EE.PPto be invoked at any time from your login .PN csh .If you are using the Bourne shell, it is notpossible to get this aliasing effect with a shell script,because shell scripts cannot set the environment of their parent..PPThese commands cause.PN tsetto place the name of your terminal in the variableTERM in the environment.  For further information, see .MS environ 7 ..PPOnce the terminal type is known,.PN tsetengages in terminal driver mode setting.This normally involves sending an initialization sequence to theterminal, setting the single character erase (and optionallythe line-kill (full line erase)) characters,and setting special character delays.Tab and newline expansion are turned off during transmission ofthe terminal initialization sequence..PPOn terminals that can backspace but not overstrike(such as a \s-2CRT\s0),and when the erase character is the default erase character(`#' on standard systems),the erase character is changed to \s-2BACKSPACE\s0 (Control-H)..PPIf.PN tsetis invoked as.PN reset ,it will set cooked and echo modes, turn off cbreak and raw modes,turn on newline translation, and restore special charactersto a sensible state before any terminal dependent processing is done.Any special character that is found to be NULLor ``\-1'' is reset to its default value..PPThis is most useful after a program dies leaving a terminal in a funnystate.You may have to type ``\s-2<LF>\s0reset\s-2<LF>\s0'' to get it to worksince \s-2<CR>\s0 may not work in this state.Often none of this will echo..SH Options.NXR "tset command" "options".IP \fB\-\fR  5Name of terminal is output on stndout, captured by the shell, andplaced in the environment variable TERM.  .IP \fB\-e\fIc\fRUses the specified character as the erase character.  The default is the backspace character on the terminal, usually ^H.The character.I ccan either be typed directly, or entered using the hatnotation used here..IP \fB\-I\fRSuppresses transmitting terminal initialization strings..IP \fB\-k\fIc\fR Uses the specified character as the kill character.  It is similar to.B \-ebut for the line kill character rather than the erase character;.I cdefaults to ^X (for purely historical reasons).The kill characters is left alone if.B \-kis not specified.The hat notation can also be used for this option..IP \fB\-n\fR Initializes the new tty driver, if applicable.  On systems with the Berkeley 4BSD tty driver,specifies that the new tty driver modes shouldbe initialized for this terminal.For a \s-2CRT\s0,the CRTERASE and CRTKILLmodes are set only if the baud rate is 1200 or greater.See .MS tty 4for more detail..IP \fB\-Q\fR Suppresses erase and kill character message.  .IP \-sOutput .PN setenv commands for TERM.  This option can be used with \fBtset \-s ...\fRand is to be preferred to setenv TERM \fBtset - ...\fR because \fB\-s\fR also sets the TERMCAP variable..IP \-SSimilar to \fB\-s\fR, but outputs 2 strings suitable foruse in csh .PN \&.login files as follows:.EX		set noglob		set term=(`tset -S .....`)		setenv TERM $term[1]		setenv TERMCAP "$term[2]"		unset term		unset noglob.EE.SH Restrictions.NXR "tset command" "restricted"For compatibility with earlier versions of.PN tseta number of flags are accepted whose use is discouraged:.TP 10\fB\-d\fR typeequivalent to.B \-mdialup:type.TP 10\fB\-p\fR typeequivalent to.B \-mplugboard:type.TP 10\fB\-a\fR typeequivalent to.B \-marpanet:type.TP 10\fB\-E\fR cSets the erase character to.I conly if the terminal can backspace..TP 10\fB\-\fRprints the terminal type on the standard output.TP 10\fB\-r\fRprints the terminal type on the diagnostic output..SH Examples.NXR "tset command"These examples all assume the Bourne shell and use the - option.If you use.PN csh ,use one of the variations described above.Note that a typical use of.PN tsetin a .profile or .login will also use the.B \-eand.B \-koptions, and often the.B \-nor.B \-Qoptions as well.These options have not been included here to keep the examples small.(\fBNOTE:\fP some of the examples given here appear to take up more thanone line, for text processing reasons.  When you type in real.PN tsetcommands, you must enter them entirely on one line.).PPAt the moment, you are on a 2621.This is suitable for typing by hand butnot for a .profile, unless you are always on a 2621..EX 0export TERM; TERM=\`tset \- 2621\`.EE.PPYou have an h19 at home which you dial up on, but your office terminalis hardwired and known in /etc/ttys..EX 0export TERM; TERM=\`tset \- \-m dialup:h19\`.EE.PPYou have a switch which connects everything to everything, makingit nearly impossible to key on what port you are coming in on.You use a vt100 in your office at 9600 baud, and dial up to switchports at 1200 baud from home on a 2621.Sometimes you use someone elses terminal at work,so you want it to ask you to make sure what terminaltype you have at high speeds, but at 1200 baud you arealways on a 2621.Note the placement of the question mark, and the quotesto protect the greater than and question mark frominterpretation by the shell..EX 0export TERM; TERM=\`tset \- \-m 'switch>1200:?vt100' \-m\&'switch<=1200:2621'.EEAll of the above entries will fall back on the terminal typespecified in .PN /etc/ttysif none of the conditions hold.The following entry is appropriate ifyou always dial up, always at the same baud rate,on many different kinds of terminals.Your most common terminal is an adm3a.It always asks you what kind of terminal you are on,defaulting to adm3a..EX 0export TERM; TERM=\`tset \- \?adm3a\`.EE.PPIf the file .PN /etc/ttysis not properly installed and you want tokey entirely on the baud rate, the following can be used:.EX 0export TERM; TERM=\`tset \- \-m '>1200:vt100' 2621\`.EE.PPHere is a fancy example to illustrate the power of.PN tsetand to hopelessly confuse anyone who has made it this far.You dial up at 1200 baud or less on a concept100,sometimes over switch ports and sometimes over regular dialups.You use various terminals at speeds higher than 1200 over switch ports,most often the terminal in your office, which is a vt100.However, sometimes you log in from the university you used to go to,over the ARPANET; in this case you are on an ALTO emulating a dm2500.You also often log in on various hardwired ports, such as the console,all of which are properly entered in .PN /etc/ttys .You want your erase character set to control H,your kill character set to control U,and do not want.PN tsetto print the ``Erase set to Backspace, Kill set to Control U'' message..EX 0export TERM; TERM=\`tset \-e \-k^U \-Q \- \-m\&'switch<=1200:concept100' \-m 'switch:?vt100' \-mdialup:concept100 \-m arpanet:dm2500\`.EE.SH Files.TP 20.PN /etc/ttysport name to terminal type mapping database.TP.PN /etc/termcapterminal capability database.SH See Alsocsh(1), sh(1), stty(1),termcap(5), ttys(5), environ(7)

⌨️ 快捷键说明

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