]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/man/tset.1.html
635ddd5335a0a73af26cfeeb3840b64ea90f50ca
[ncurses.git] / doc / html / man / tset.1.html
1 <HTML>
2 <BODY>
3 <PRE>
4 <!-- Manpage converted by man2html 3.0.1 -->
5
6 </PRE>
7 <H2>NAME</H2><PRE>
8        <B>tset</B>, <B>reset</B> - terminal initialization
9
10
11 </PRE>
12 <H2>SYNOPSIS</H2><PRE>
13        tset  [-IQVqrs]  [-]  [-e <I>ch</I>] [-i <I>ch</I>] [-k <I>ch</I>] [-m <I>mapping</I>]
14        [<I>terminal</I>]
15        reset [-IQVqrs] [-] [-e <I>ch</I>] [-i <I>ch</I>] [-k <I>ch</I>]  [-m  <I>mapping</I>]
16        [<I>terminal</I>]
17
18
19 </PRE>
20 <H2>DESCRIPTION</H2><PRE>
21        <B>Tset</B>  initializes  terminals.   <B>Tset</B>  first determines the
22        type of terminal that you are using.   This  determination
23        is done as follows, using the first terminal type found.
24
25        1. The <B>terminal</B> argument specified on the command line.
26
27        2. The value of the <B>TERM</B> environmental variable.
28
29        3.  (BSD  systems only.) The terminal type associated with
30        the standard error output device in  the  <I>/etc/ttys</I>  file.
31        (On Linux and System-V-like UNIXes, <I>getty</I> does this job by
32        setting <B>TERM</B>  according  to  the  type  passed  to  it  by
33        <I>/etc/inittab</I>.)
34
35        4. The default terminal type, ``unknown''.
36
37        If  the  terminal  type  was not specified on the command-
38        line, the -m option mappings are then applied  (see  below
39        for  more information).  Then, if the terminal type begins
40        with a question mark (``?''), the  user  is  prompted  for
41        confirmation of the terminal type.  An empty response con-
42        firms the type, or, another type can be entered to specify
43        a  new  type.  Once the terminal type has been determined,
44        the terminfo entry for the terminal is retrieved.   If  no
45        terminfo entry is found for the type, the user is prompted
46        for another terminal type.
47
48        Once the terminfo entry is  retrieved,  the  window  size,
49        backspace,  interrupt and line kill characters (among many
50        other things) are set and the terminal and tab initializa-
51        tion  strings  are  sent  to  the  standard  error output.
52        Finally, if the erase, interrupt and line kill  characters
53        have  changed,  or  are  not  set to their default values,
54        their values are displayed to the standard error output.
55
56        When invoked as <B>reset</B>, <B>tset</B> sets cooked  and  echo  modes,
57        turns  off cbreak and raw modes, turns on newline transla-
58        tion and resets any  unset  special  characters  to  their
59        default  values  before  doing the terminal initialization
60        described above.  This is  useful  after  a  program  dies
61        leaving  a  terminal  in an abnormal state.  Note, you may
62        have to type
63
64            <B>&lt;LF&gt;reset&lt;LF&gt;</B>
65
66        (the line-feed character is normally control-J) to get the
67        terminal to work, as carriage-return may no longer work in
68        the abnormal state.  Also, the  terminal  will  often  not
69        echo the command.
70
71        The options are as follows:
72
73        -q   The  terminal  type is displayed to the standard out-
74             put, and the terminal is not initialized in any  way.
75             The option `-' by itself is equivalent but archaic.
76
77        -e   Set the erase character to <I>ch</I>.
78
79        -I   Do  not  send  the  terminal  or  tab  initialization
80             strings to the terminal.
81
82        -Q   Don't display any values for the erase, interrupt and
83             line kill characters.
84
85        <B>-V</B>   reports the version of ncurses which was used in this
86             program, and exits.
87
88        -i   Set the interrupt character to <I>ch</I>.
89
90        -k   Set the line kill character to <I>ch</I>.
91
92        -m   Specify a mapping from a port  type  to  a  terminal.
93             See below for more information.
94
95        -r   Print the terminal type to the standard error output.
96
97        -s   Print the sequence of shell  commands  to  initialize
98             the environment variable <B>TERM</B> to the standard output.
99             See the section below on setting the environment  for
100             details.
101
102        The arguments for the -e, -i, and -k options may either be
103        entered as actual characters or by using the  `hat'  nota-
104        tion, i.e. control-h may be specified as ``^H'' or ``^h''.
105
106
107 </PRE>
108 <H2>SETTING THE ENVIRONMENT</H2><PRE>
109        It is often desirable  to  enter  the  terminal  type  and
110        information  about  the  terminal's  capabilities into the
111        shell's environment.  This is done using the -s option.
112
113        When the -s option is specified, the commands to enter the
114        information  into  the  shell's environment are written to
115        the standard output.  If the <B>SHELL</B> environmental  variable
116        ends in ``csh'', the commands are for <B>csh</B>, otherwise, they
117        are for <B>sh</B>.  Note, the <B>csh</B>  commands  set  and  unset  the
118        shell  variable  <B>noglob</B>,  leaving it unset.  The following
119        line in the <B>.login</B> or <B>.profile</B> files will  initialize  the
120        environment correctly:
121
122            eval `tset -s options ... `
123
124
125
126 </PRE>
127 <H2>TERMINAL TYPE MAPPING</H2><PRE>
128        When the terminal is not hardwired into the system (or the
129        current system information is incorrect) the terminal type
130        derived  from the <I>/etc/ttys</I> file or the <B>TERM</B> environmental
131        variable is often something generic like <B>network</B>,  <B>dialup</B>,
132        or  <B>unknown</B>.   When <B>tset</B> is used in a startup script it is
133        often desirable to provide information about the  type  of
134        terminal used on such ports.
135
136        The  purpose  of  the -m option is to map from some set of
137        conditions to a terminal type, that is, to tell <B>tset</B>  ``If
138        I'm  on this port at a particular speed, guess that I'm on
139        that kind of terminal''.
140
141        The argument to the -m option consists of an optional port
142        type, an optional operator, an optional baud rate specifi-
143        cation, an optional colon (``:'') character and a terminal
144        type.   The port type is a string (delimited by either the
145        operator or the colon character).  The operator may be any
146        combination of ``&gt;'', ``&lt;'', ``@'', and ``!''; ``&gt;'' means
147        greater than, ``&lt;'' means less than, ``@'' means equal  to
148        and ``!'' inverts the sense of the test.  The baud rate is
149        specified as a number and is compared with  the  speed  of
150        the  standard  error  output  (which should be the control
151        terminal).  The terminal type is a string.
152
153        If the terminal type is not specified on the command line,
154        the  -m mappings are applied to the terminal type.  If the
155        port type and baud rate match the  mapping,  the  terminal
156        type  specified  in the mapping replaces the current type.
157        If more than one mapping is specified, the first  applica-
158        ble mapping is used.
159
160        For    example,    consider    the    following   mapping:
161        <B>dialup&gt;9600:vt100</B>.  The port type is dialup , the operator
162        is  &gt;, the baud rate specification is 9600, and the termi-
163        nal type is vt100.  The result of this mapping is to spec-
164        ify that if the terminal type is <B>dialup</B>, and the baud rate
165        is greater than 9600 baud, a terminal type of  <B>vt100</B>  will
166        be used.
167
168        If no baud rate is specified, the terminal type will match
169        any baud rate.  If no port type is specified, the terminal
170        type   will   match   any  port  type.   For  example,  <B>-m</B>
171        <B>dialup:vt100</B>  <B>-m</B>  <B>:?xterm</B>  will  cause  any  dialup  port,
172        regardless of baud rate, to match the terminal type vt100,
173        and any non-dialup port type to match  the  terminal  type
174        ?xterm.   Note,  because of the leading question mark, the
175        user will be queried on a default port as to whether  they
176        are actually using an xterm terminal.
177
178        No  whitespace  characters  are permitted in the -m option
179        argument.  Also, to avoid problems  with  meta-characters,
180        it  is  suggested  that  the  entire -m option argument be
181        placed within single quote characters, and that <B>csh</B>  users
182        insert  a  backslash character (``\'') before any exclama-
183        tion marks (``!'').
184
185
186 </PRE>
187 <H2>HISTORY</H2><PRE>
188        The <B>tset</B> command appeared in BSD 3.0.  The <B>ncurses</B>  imple-
189        mentation  was lightly adapted from the 4.4BSD sources for
190        a terminfo environment by Eric S. Raymond &lt;esr@snark.thyr-
191        sus.com&gt;.
192
193
194 </PRE>
195 <H2>COMPATIBILITY</H2><PRE>
196        The  <B>tset</B>  utility has been provided for backward-compati-
197        bility with BSD environments (under  most  modern  UNIXes,
198        <B>/etc/inittab</B>  and  <B><A HREF="getty.1.html">getty(1)</A></B> can set <B>TERM</B> appropriately for
199        each dial-up line; this  obviates  what  was  <B>tset</B>'s  most
200        important  use).   This implementation behaves like 4.4BSD
201        tset, with a few exceptions specified here.
202
203        The -S option of BSD tset no longer works;  it  prints  an
204        error message to stderr and dies.  The -s option only sets
205        <B>TERM</B>, not <B>TERMCAP</B>.  Both these  changes  are  because  the
206        <B>TERMCAP</B>  variable  is  no longer supported under terminfo-
207        based <B>ncurses</B>, which makes <B>tset</B> <B>-S</B> useless (we made it die
208        noisily rather than silently induce lossage).
209
210        There  was  an  undocumented  4.4BSD feature that invoking
211        tset via a link named `TSET` (or via any other name begin-
212        ning  with  an  upper-case letter) set the terminal to use
213        upper-case only.  This feature has been omitted.
214
215        The -A, -E, -h, -u and -v options were  deleted  from  the
216        <B>tset</B>  utility  in  4.4BSD. None of them were documented in
217        4.3BSD and all are of limited utility at best. The -a, -d,
218        and -p options are similarly not documented or useful, but
219        were retained as they appear to be in widespread use.   It
220        is  strongly  recommended  that  any  usage of these three
221        options be changed to use the -m option instead.   The  -n
222        option  remains, but has no effect.  The -adnp options are
223        therefore omitted from the usage summary above.
224
225        It is still permissible to specify  the  -e,  -i,  and  -k
226        options  without arguments, although it is strongly recom-
227        mended that such usage be fixed to explicitly specify  the
228        character.
229
230        As  of  4.4BSD,  executing <B>tset</B> as <B>reset</B> no longer implies
231        the -Q option.  Also, the interaction between the - option
232        and the <I>terminal</I> argument in some historic implementations
233        of <B>tset</B> has been removed.
234
235
236
237 </PRE>
238 <H2>ENVIRONMENT</H2><PRE>
239        The <B>tset</B> command uses the <B>SHELL</B> and <B>TERM</B> environment vari-
240        ables.
241
242
243 </PRE>
244 <H2>FILES</H2><PRE>
245        /etc/ttys
246             system  port  name  to terminal type mapping database
247             (BSD versions only).
248
249        /usr/share/terminfo
250             terminal capability database
251
252
253 </PRE>
254 <H2>SEE ALSO</H2><PRE>
255        <B><A HREF="csh.1.html">csh(1)</A></B>, <B><A HREF="sh.1.html">sh(1)</A></B>, <B><A HREF="stty.1.html">stty(1)</A></B>, <B><A HREF="tty.4.html">tty(4)</A></B>, <B><A HREF="termcap.5.html">termcap(5)</A></B>, <B><A HREF="ttys.5.html">ttys(5)</A></B>, envi-
256        <B><A HREF="ron.7.html">ron(7)</A></B>
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296 </PRE>
297 <HR>
298 <ADDRESS>
299 Man(1) output converted with
300 <a href="http://www.oac.uci.edu/indiv/ehood/man2html.html">man2html</a>
301 </ADDRESS>
302 </BODY>
303 </HTML>