Consolidate license copies
[its.git] / sysdoc / itstty.41
1 -*-TEXT-*- 
2 Copyright (c) 1999 Massachusetts Institute of Technology
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or (at
7 your option) any later version.
8
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 ------------------------------
18
19 \1f
20 File: ITSTTY    Node: Top       Next: A                 Up: (DIR)
21
22 This file describes just about all there is to know about using and 
23 programming TTYs (abbreviation for "Teletypes", for which read "consoles")
24 on the ITS operating system.
25
26 * Menu:
27
28 * Special: A    Characters specially interpreted when typed on the tty.
29 * Control: B    "Control of the tty".
30 * Opening: C    Opening tty channels.
31 * Input:   D    Input from terminals.
32 * Output:  E    Output to terminals.
33 * More:    F    **MORE** processing.
34 * Vars:    G    Per-tty/per-job variables.
35 * Perm:    H    Permanent and semipermanent tty information.
36 * STYs:    I    Pseudo-teletypes (STYs).
37 * Smart:   J    The intelligent terminal protocol.
38 * SofTTYs: K    Software ttys and ITS output buffer codes.
39
40
41 This is the complete table of contents for this file:
42
43 A. CHARACTERS SPECIALLY INTERPRETED WHEN TYPED ON THE TTY.
44    1. INTERRUPTING THE PROGRAM - THE CALL FUNCTION.
45       a. Deferred CALL.
46    2. ENTERING STRANGE CHARACTERS - THE ESCAPE FUNCTION.
47       a. Quoting the Characters Used for CALL and ESCAPE.
48       b. "^_<number>".
49       c. Supplying Meta-Bits on Non-TV's.
50    3. MODE SETTING USING ESCAPE.
51       a. "^_M" - Complement **MORE** Processing (%TSMOR).
52       b. "^_^" - Complement Scroll-mode (%TSROL).
53       c. "^_""" - Complement Use of SAIL Character Set (%TSSAI).
54       d. "^_U" - Complement conversion to upper case (%TOCLC)
55    4. COMMUNICATE MODE.
56       a. Entering a Com Link.
57       b. Querying.
58       c. Leaving a Com Link.
59       d. When the System Prints "^_N".
60       e. Input and Output Overrides.
61       f. Slaving Another Terminal.
62       g. Telling the System How to Respond to "^_C" Requests.
63    5. LIST OF ESCAPE CODES.
64
65 B. "CONTROL OF THE TTY".
66    1. WHAT DETERMINES WHO HAS THE TTY.
67    2. .ATTY AND .DTTY.
68    3. PERMISSION TO TYPE OUT.
69    4. THE .TTY VARIABLE.
70    5. THE .CNSL VARIABLE.
71
72 C. OPENING TTY CHANNELS.
73    1. OPENING "TTY".
74    2. OPENING "Tnm".
75    3. DEVICE-DEPENDENT BITS IN THE OPEN MODE.
76       a. Per-channel Bits.
77       b. Other Per-channel Bits on Input.
78       c. Other Per-channel Bits on Output.
79       d. First-time Bits on Output.
80       e. First-time Bits on Input.
81
82 D. INPUT FROM TERMINALS.
83    1. ECHO.
84    2. MAIN-PROGRAM INPUT.
85    3. ACTIVATION.
86    4. INPUT INTERRUPTS.
87    5. THROWING AWAY TYPE-IN.
88    6. TESTING FOR THE AVAILABILITY OF INPUT.
89    7. .STATUS ON TTY INPUT CHANNELS.
90    8. THE CHARACTER SET
91
92 E. OUTPUT TO TERMINALS.
93    1. HOW TO CAUSE CHARACTERS TO BE OUTPUT.
94    2. NORMAL OUTPUT (SEQUENTIAL ACCESS).
95       a. How the System Goes about Outputting.
96          1: ASCII Graphic Characters.
97          2: "^G".
98          3: Carriage-return.
99          4: Linefeed.
100          5: Tab.
101          6: Control-L (Formfeed).
102          7: Altmode.
103          8: Control-P.
104          9: Backspace.
105          10: Random Control Characters, and Rubout.
106       b. Continuation - the Result of Line-overflow.
107       c. Wraparound and Scrolling - the Results of Page-overflow.
108          1: Scrolling.
109          2: Wraparound.
110    3. DISPLAY-MODE CHANNELS. ^P-CODES.
111    4. THE ECHO AREA.
112       a. How the Echo Area Works.
113       b. Creating an Echo Area.
114    5. READING THE CURSOR POSITION.
115    6. SUPERIMAGE OUTPUT.
116    7. RELEVANT TTYOPT BITS.
117    8. THROWING AWAY TYPEOUT.
118    9. WAITING FOR OUTPUT TO BE SENT TO THE TERMINAL.
119    10. .STATUS ON TTY OUTPUT CHANNELS.
120
121 F. **MORE** PROCESSING.
122    1. WHEN **MORE** PROCESSING IS TRIGGERED.
123    2. HOW **MORE** PROCESSING OPERATES.
124       a. Stupid Programs.
125       b. Smart Programs.
126    3. PROGRAMMED INVOCATION OF **MORE** PROCESSING.
127    4. INHIBITION OF **MORE** PROCESSING BY INPUT.
128
129 G. PER-TTY/PER-JOB VARIABLES.
130    1. THE VARIABLES.
131          a. the TTYST1 and TTYST2 variables.
132          b. The TTYSTS variable.
133          c. The Size of the Echo Area.
134    2. SYMBOLIC SYSTEM CALLS.
135       a. TTYGET - read TTYST1, TTYST2, TTYSTS.
136       b. TTYSET - set TTYST1, TTYST2, TTYSTS.
137       c. SCML - Set Number of Command Lines.
138
139 H. PERMANENT AND SEMIPERMANENT TTY INFORMATION.
140    1. THE VARIABLES.
141       a. The Screen Size.
142       b. The TTYOPT variable.
143       c. The TCTYP variable.
144       d. The TTYTYP variable.
145       e. The TTYCOM variable.
146       f. The TTYROL variable or "Scroll Count".
147       g. The TTYSMT variable.
148    2. SYSTEM CALLS.
149       a. RSSIZE.
150       b. CNSGET.
151       c. CNSSET.
152       d. TTYVAR.
153
154 I. PSEUDO-TELETYPES (STY'S).
155    1. OPENING STY'S.
156    2. OUTPUT TO STY'S.
157       a. What happens when the buffer is empty.
158       b. Interrupts.
159       c. RESET on sty output channels.
160       d. STATUS on sty output channels.
161    3. INPUT FROM STY'S.
162       a. What happens when the buffer is empty.
163       b. Interrupts.
164       c. .STATUS on sty input channels.
165       d. .RESET on sty input channels.
166    4. CLOSING STY'S.
167    5. CONTROLLING THE TTY ASSOCIATED WITH A STY.
168    6. DIRECT CONNECTIONS TO NETWORK CHANNELS:  STYNET.
169    7. STYGET.
170
171 J. THE INTELLIGENT TERMINAL PROTOCOL.
172    1. ESCAPE SEQUENCES.
173    2. ALLOCATION.
174    3. OUTPUT-RESET.
175
176 K. SOFTWARE TTYS AND ITS OUTPUT BUFFER CODES.
177    1. ITS OUTPUT BUFFER CODES.
178    2. HANDLING %TDORS.
179    3. THE SCPOS SYSTEM CALL.
180 \1f\f
181 File: ITSTTY,  Node: A,  Previous: Top,  Up: Top,  Next: B
182
183 A. CHARACTERS SPECIALLY INTERPRETED WHEN TYPED ON THE TTY.
184
185 Normally, characters type on terminal keyboards have effect only
186 by being read and acted on by user programs.  There are, however,
187 a few important exceptions.
188
189 * Menu:
190
191 * Interrupting:  A/1    Interrupting the program - the CALL function
192 * Strange:       A/2    Entering strange characters - the ESCAPE function
193 * Mode Setting:  A/3    Mode setting using ESACPE
194 * Communicate:   A/4    Communicate mode
195 * Escape Codes:  A/5    List of ESCAPE codes
196 \1f\f
197 File: ITSTTY,  Node: A/1,  Previous: A,  Up: A,  Next: A/2
198
199  1. INTERRUPTING THE PROGRAM - THE CALL FUNCTION.
200
201 A function available on all terminals that are in use as
202 consoles is to stop the current program and interrupt its
203 superior.  On TV's, this function is requested by hitting the
204 "CALL" key; on other terminals, which have no "CALL" key, the
205 character "^Z" is used.  This makes the character "^Z" difficult
206 to type in as a normal characters on such terminals, requiring
207 quoting (*Note Quoting: A/2.).
208
209 In detail, the CALL function gives the job which owns the tty 
210 (*Note TTY-owning: B.) a fatal interrupt, causing its superior in the
211 tree to be interrupted.  The superior will usually react by retrieving
212 the terminal from the job that had posessed it.  Thus, CALL makes it
213 possible to regain control when the program that has the terminal is
214 out of control. 
215
216 When the terminal is in super-image input mode (%TSSII is 1),
217 the CALL function is disabled - attempts to use it merely
218 generate input to the program.  Programs should not lightly enter
219 this mode.
220
221   a. Deferred CALL
222
223 If you want to return from a program to DDT after the program is
224 finished, if you use ordinary CALL you must not type it until then. 
225 And since DDT will flush all input when it sees the CALL, you can't
226 type anything else until you have seen DDT respond.
227
228 The "deferred CALL", which you can type as Control-CALL on a TV or as
229 ^_D on any terminal, does about the same thing that ordinary CALL does
230 except that it does not take effect until the program tries to read
231 it.  It thus acts like an "exit" command in all programs.  DDT
232 distinguishes deferred CALLs from ordinary ones (deferred ones give the
233 program a %PIDCL interrupt instead of a %PIC.Z), and does not throw
234 away input.  Thus, you can type the deferred CALL ahead, and also some
235 DDT commands to follow it.
236 \1f\f
237 File: ITSTTY,  Node: A/2,  Previous: A/1,  Up: A,  Next: A/3
238
239  2. ENTERING STRANGE CHARACTERS - THE ESCAPE FUNCTION.
240
241 The ESCAPE function is requested by typing "BACK-NEXT" on TV's.  
242 This character is available as "^_" (control-underscore) on most
243 terminals which have no "BACK-NEXT" key; on Lisp Machine keyboards it
244 is labeled SCROLL or MACRO.
245
246 The character used for the ESCAPE function is hard to type in, just as
247 the character used for the CALL function is.  However, it provides a
248 mechanism that solves those problems.  Note that the ITS ESCAPE
249 terminal function should not be confused with the "ESCAPE" key on TV
250 keyboards, which escapes all the way to the PDP-11 which handles the TV's.
251
252 In the following, "^_" will designate the ESCAPE function, unless
253 otherwise stated, regardless of whether it is actually obtained by
254 the character "^_".
255
256 * Menu:
257
258 * Quoting:      A/2/a   Quoting the chars used for CALL and ESCAPE
259 * ^_<number>:   A/2/b   
260 * Meta-bits:    A/2/c   Supplying Meta-Bits on Non-TV's
261 \1f\f
262 File: ITSTTY,  Node: A/2/a,  Previous: A/2,  Up: A/2,  Next: A/2/b
263
264   a. Quoting the Characters Used for CALL and ESCAPE.
265
266 One of the uses of the ESCAPE function is to enter characters
267 that are not on the keyboard or otherwise hard to type in.  The
268 characters used for the CALL and ESCAPE functions may be entered
269 as normal input by preceding them with an ESCAPE, which "quotes"
270 them.  For example, on a non-TV, typing "^_^_" causes a single
271 "^_" to be read by the program, to interrupt if the program has
272 enabled interrupts, etc., and "^_^Z" does the same thing for
273 "^Z".
274 \1f\f
275 File: ITSTTY,  Node: A/2/b,  Previous: A/2/a,  Up: A/2,  Next: A/2/c
276
277   b. "^_<number>".
278
279 If the terminal's keyboard is missing a character, that
280 character may be entered by typing ESCAPE followed by the octal
281 numerical code for the character.  The number may have any number
282 of digits, and is terminated by the first non-digit.  If that
283 non-digit is a space, it is discarded; otherwise, it is taken
284 normally as input.  The character entered as digits will be echoed
285 (if echoing of that character is turned on).  Thus, "^_001 "
286 inputs a "^A" and echoes as "^_001^A", and "^_1q" enters "^Aq"
287 and echoes as "^_1^Aq".
288 \1f\f
289 File: ITSTTY,  Node: A/2/c,  Previous: A/2/b,  Up: A/2,  Next: A/3
290
291   c. Supplying Meta-Bits on Non-TV's.
292
293 It is possible to enter characters in the TV character set that are not in
294 ASCII, using the ESCAPE function followed by ^B, ^C, ^D, or ^F, followed by
295 the basic ASCII character.  ^B means "set the CONTROL bit"; ^C, the META
296 bit; ^F, the SUPER bit; ^D, the TOP bit.  Any combination of those four
297 characters should be followed by the basic ASCII character with which those
298 bits will be OR'ed.  To specify one of those four control characters, or
299 ^Q, as the basic ASCII character, quote it with ^Q.  For example, "^_^B^C1"
300 specifies CONTROL-META-1.  "^_^BA" is CONTROL-A, which has the code 301,
301 and is not the same as ^A (code 001).  The TOP bit is useful for programs
302 (such as TECO) which distinuish SAIL graphics characters from CONTROL
303 characters.  TECO treats an ASCII ^K as an alias for CONTROL-K, but ^_^D^K
304 (TOP-^K) is believed to be the SAIL character Uparrow.
305
306 The reason that ^B and ^C stand for CONTROL and META is that
307 they correspond to the SAIL characters Alpha and Beta, which
308 are traditionally used for this purpose.
309
310 \1f\f
311 File: ITSTTY,  Node: A/3,  Previous: A/2,  Up: A,  Next: A/4
312
313  3. MODE SETTING USING ESCAPE.
314
315 Most of the switches that are associated with each terminal are
316 intended to be set or cleared by means of the TCTYP program.
317 However, there are two switches for which each job that can use the
318 terminal has its own setting.  The TCTYP program may be used to set the
319 default values of the switches, which are used to initialize new jobs.
320 ESCAPE codes are provided for complementing the switch associated with
321 the job that the terminal belongs to at the moment.
322
323   a. "^_M" - Complement **MORE** Processing (%TSMOR).
324
325 When **MORE** processing is enabled, the system causes output to
326 pause at the bottom of the screen, until a space is typed.
327
328   b. "^_^" - Complement Scroll-mode (%TSROL).
329
330 When a terminal is in scroll mode, linefeeding past the bottom
331 of the screen causes everything on the screen to move up,
332 instead of wrapping around to write at the top of the screen.
333
334   c. "^_""" - Complement Use of SAIL Character Set (%TSSAI).
335
336 When %TSSAI is set, ascii mode and echo mode output of
337 non-formatting control characters will send the character
338 unmodified, assuming it to be a graphic character.  Thus, "^B"
339 will echo as an alpha, etc., on terminals that can handle the
340 SAIL character set.
341
342   d. "^_U" - Complement conversion to upper case (%TOCLC)
343
344 When %TOCLC is set, characters typed at the terminal are converted
345 to uppercase.
346 \1f\f
347 File: ITSTTY,  Node: A/4,  Previous: A/3,  Up: A,  Next: A/5
348
349  4. COMMUNICATE MODE.
350
351 It is possible for a group of terminals to be put in a "com
352 link".  When that is done, anything typed on any one of the
353 terminals echoes on all of them.  Normally, what is typed on a
354 terminal that is in a com link is ignored except for that
355 echoing, however the user may cause it to be treated as normal
356 input (see "^_I").  Also, programs are usually prohibited from
357 typing out while the tty is in a com link, but that may be
358 changed by the user (see "^_O").  It is also possible to cause
359 one of the terminals in a com link to supply input for and view
360 the output from another (see "^_S" and "^_E").
361
362 * Menu:
363
364 * Entering:     A/4/a   Entering a COM link
365 * Querying:     A/4/b
366 * Leaving:      A/4/c   Leaving a COM link
367 * ^_N:          A/4/d   When the system prints "^_N"
368 * Overrides:    A/4/e   Input and output overrides.  "^_I" and "^_O".
369 * Slaving:      A/4/f   Slaving another terminal.  "^_S" and "^_E".
370 * Respond:      A/4/g   Telling the system how to respond to "^_C" requests
371 \1f\f
372 File: ITSTTY,  Node: A/4/a,  Previous: A/4,  Up: A/4,  Next: A/4/b
373
374   a. Entering a Com Link.
375
376 From any terminal, a com link with any other terminal may be
377 requested by means of "^_C", which should be followed by the
378 number of the terminal to be linked to, or by the uname of the
379 user logged in on that terminal.  The name or number is terminated
380 by the first space or CR, except that any number of spaces or
381 CR's may follow right after the "C" and will be ignored.
382
383 It is allowed for either the terminal on which "^_C" is typed or
384 the terminal to which a link is requested to be in a com link
385 already; in either case, if the request succeeds both of the
386 terminals and all the other terminals that had been linked to
387 either of them will form one com link.  If there is no terminal
388 with the specified number, or no one is logged in with the
389 specified uname, the "^_C" will have no effect, and a "?" will
390 be typed.  The same thing will happen if the specified terminal
391 is already in a com link with the requesting terminal.  If the
392 specified terminal is in the middle of typing in an ESCAPE code,
393 or has characters unprocessed in its input buffer, the "^_C"
394 fails, typing "Busy".  When that happens, it is reasonable to
395 try again in a few seconds.  If the specified terminal's user
396 has ordered it ro refuse com links, with "^_R"
397 (it is in "refuse mode"), then "Refused" will be typed, and the
398 request will fail.  If these conditions for "^_C" are met, the
399 request is basically acceptible, and what happens to it depends
400 on whether the specified terminal is in "accept mode" (the usual
401 case) or in "query mode".  In accept mode, the two terminals will
402 be linked right away.  If the target terminal is already in a com
403 link, a list of the terminals in that com link will be typed out
404 and the user will be asked whether he wants to "break in".  An
405 answer other than "Y" or "y" will abort the request.  In query
406 mode, the specified terminal must be asked whether the link
407 should be made - that process will be described later.
408
409 Assuming that the specified terminal is in accept mode, and that
410 if necessary the user has decided to break in, then, the link
411 will be created, and the requesting terminal will be informed
412 that the request has succeeded by a "OK".  "F" will be typed in
413 addition if the specified terminal is free.  The "OK" tells the
414 requesting user that he is linked to the specified terminal, but
415 he may also be linked without knowing to other terminals already
416 linked to the specified terminal.  Also, the other terminals in
417 the link at this point know nothing.  Therefore, messages are
418 typed on the terminals as follows:  on the specified terminal and
419 all terminals linked to it, the message "LINK FROM <list of
420 terminals and users>" will be typed, where the <list> includes
421 the requesting terminal and all terminals linked to it, and a
422 terminal is referred to by its uname if it is a logged in
423 console, and as "Tnn" otherwise.  Also, if there are other
424 terminals already linked to the requesting terminal, the message
425 "LINK TO <list>" will be typed, naming the specified terminal
426 and any other terminals linked to it.  Also, if the specified
427 terminal is already linked to others, the message
428 "LINK TO <list>" naming only those others, and not the specified
429 terminal, will appear on the requesting terminal.  The result of
430 all of those messages is that each terminal that ends up in the
431 new com link is informed of all the other terminals that it is
432 becoming linked to.
433 \1f\f
434 File: ITSTTY,  Node: A/4/b,  Previous: A/4/a,  Up: A/4,  Next: A/4/c
435
436   b. Querying.
437
438 When the specified terminal is in query mode (*Note ^_Q: A/4/g.),
439 "QUERYING" is typed on the requesting terminal, and the "LINK FROM ..."
440 message is typed on the specified terminal only (NOT on the
441 terminals linked to it already), followed by "QUERYING", which
442 informs its user that he is being queried.  He need not
443 pay immediate attention to the query, and his commands will
444 continue to go to his program.  When he wishes to respond,
445 he may do "^_Y" to accept the link, "^_Z" to to refuse it,
446 "^_Q" to list the people querying, or "^_C" to a specific
447 user querying him.  Such a "^_C" will always succeed
448 immediately, even if the target is in refuse mode or query mode,
449 as long as he is querying the "^_C"'er.  This is how to
450 accept some but not all of several simultaneous queries.
451 When a query is accepted or rejected, "OK" or "REFUSED" will be
452 typed on the requesting terminal.  Until that happens,
453 the requesting terminal may not do anything but "^_N" to give up
454 waiting, aborting the request, or ^G, which echoes on the terminal
455 being queried, to attract its user's attention.  If "^_N" is
456 used to abort the request, the queried terminal is not informed.
457 If the request is accepted, "OK", the "LINK TO ..." messages and
458 the remaining "LINK FROM ..." messages are typed as they would
459 have been for accept mode.
460 \1f\f
461 File: ITSTTY,  Node: A/4/c,  Previous: A/4/b,  Up: A/4,  Next: A/4/d
462
463   c. Leaving a Com Link.
464
465 Any terminal may be removed from a com link by typing "^_N" on it.
466 Also, any terminal in a com link may remove any of the other
467 terminals from that link by typing "^_K" followed by the uname or
468 number of the terminal to be unlinked (using the same syntax as
469 "^_C").  If there is only one terminal left in the com link, the link
470 is destroyed, and that terminal also returns to normal.  Otherwise
471 the terminals remaining in the link continue to be linked, and
472 "BYE FROM <unlinking terminal>" is typed on each of them.
473 \1f\f
474 File: ITSTTY,  Node: A/4/d,  Previous: A/4/c,  Up: A/4,  Next: A/4/e
475
476   d. When the System Prints "^_N".
477
478 Whenever a terminal enters a com link, or makes a "^_C" request,
479 it is said to enter "com mode".  That causes input not to be passed
480 to the program, and prevents programs from typing out (but see "^_I"
481 and "^_O").  This state persists until the terminal is no longer in
482 com mode.  Therefore, the system informs the user that the terminal
483 has left com mode by typing "^_N" on the terminal, unless the
484 terminal has left com mode because the user has just typed "^_N"
485 on it (the idea is that if a "^_N" has just echoed there is no need
486 to supply another).
487 \1f\f
488 File: ITSTTY,  Node: A/4/e,  Previous: A/4/d,  Up: A/4,  Next: A/4/f
489
490   e. Input and Output Overrides.
491
492 Normally, on a terminal in com mode input is not passed to the
493 program and programs may not type out (.IOT's hang).  That can be
494 explicitly changed with "^_I" and "^_O".  "^_O" complements the
495 %TCOCO switch which, if on, allows programs to output to the terminal
496 even when it is in com mode.  %TCOCO is initialized to 0 whenever
497 a terminal is initialized (when it starts to be used after being
498 free for a while).  DDT turns %TCOCO on temporarily when printing
499 unsolicited messages such as "ITS GOING DOWN".  %TCOCO can be set
500 with :TCTYP OCO and cleared with :TCTYP NO OCO.
501 "^_I" complements the %TCICO switch which, if on, causes input to
502 be passed to the program even when in com mode, and also allows
503 programs to type out (just like %TCOCO).  %TCICO is initialized
504 to 0 at the same time as %TCOCO, and may also be set with :TCTYP.
505 Note that when the switch is off all characters echo regardless of
506 what the program has requested, but when the switch is on, characters
507 echo or not just as they would when not in com mode, according to
508 the program's setting of the TTYST1 and TTYST2 variables.
509 \1f\f
510 File: ITSTTY,  Node: A/4/f,  Previous: A/4/e,  Up: A/4,  Next: A/4/g
511
512   f. Slaving Another Terminal.
513
514 In any com link at any time one terminal may be slaved.  That means
515 that those other terminals that wish to may supply input to the
516 program using the slaved terminal, and see the output typed on it.
517 (Actually, it isn't too hard to cause there to be two slaved
518 terminals in a link).  Any terminal that is slaved will always see
519 program output, regardless of the setting of the "^_O" switch.
520 The "^_I" switch functions normally on slaved terminals.
521 Any terminal may explicitly slave any other terminal
522 linked to it, by means of "^_S", which has the same syntax as "^_C".
523 This automatically unslaves all terminals in the link other than
524 the one requested to be slaved.
525 Each terminal has a switch that determines whether input typed on
526 it should be sent to the slaved terminal in the link, if there is
527 one.  This switch is complemented by "^_E", and initialized off when
528 com mode is entered.  If there are exactly two terminals in the link,
529 typing "^_E" on one automatically does a "^_S" to the other.
530 Otherwise, both the "^_E" and the "^_S" must be done to get any
531 effect.  If a terminal's "^_I" switch and its "^_E" switch are both
532 set, input from it will be fed to both its own programs and those of
533 the slaved terminal.  That is, the two switches are independent.
534 Similarly, the "^_O" switch does not interact with the "^_E" switch.
535 \1f\f
536 File: ITSTTY,  Node: A/4/g,  Previous: A/4/f,  Up: A/4,  Next: A/5
537
538   g. Telling the System How to Respond to "^_C" Requests.
539
540 Any terminal may be in any one of three modes: accept mode, refuse
541 mode, and query mode.  Accept mode is the default, and causes "^_C"
542 requests to succeed; refuse mode causes them to fail; query mode
543 causes them to query as described in section b.  Accept mode may be
544 entered by typing "^_A"; refuse mode, by "^_R"; query mode, by "^_Q".
545 In addition, "^_A" accepts all pending queries, and "^_R" refuses them.
546 The program TCTYP also has the capability of changing the mode, using
547 the CNSSET system call.  The information is stored in the bits %TCRFS
548 and %TCQRY in the TTYCOM variable (*Note Combits: H/1/e.).
549 \1f\f
550 File: ITSTTY,  Node: A/5,  Previous: A/4,  Up: A
551
552  5. LIST OF ESCAPE CODES.
553
554 In most cases, the escape code name is also the name of a footnote
555 leading to a node containing more details on the specific code.
556
557 ^_^Z    Program receives "^Z".  No quitting action, etc.
558 ^_^_      "   "  "^_".  No special action
559 ^_"     Complement %TSSAI for the job which has the tty.
560         That flag, if 1, says that the SAIL character set should be
561         used for echo mode and ascii mode output.  *Note ": E/2/a.
562 ^_<number>
563         Enter the character whose ASCII code is <number>.
564           *Note nnn: A/2/b.
565 ^_A     Set "accept mode".  *Note A: A/4/g.
566 ^_B     Cause typeout to pause.  *Note B: F/1.
567 ^_C     Communicate with another terminal.  *Note C: A/4/a.
568 ^_D     Deferred Call.  *Note D: A/1/a.
569 ^_E     Start or stop sending input to a slaved terminal.
570           *Note E: A/4/f.
571 ^_I     Complement the input override flag (%TCICO).  *Note I: A/4/e.
572 ^_J     Give a %PIJST interrupt to the job that has the tty, or the closest
573         superior that has the interrupt enabled.
574 ^_K     Take some other terminal out of com link.  *Note K: A/4/c.
575 ^_L     Clears the screen (echoes "^PC").
576 ^_M     Complement **MORE** processing for job that has the tty.
577         *Note M: F/2.
578 ^_N     Leave com link or quit waiting for answer to query.
579         *Note N: A/4/c.
580 ^_O     Complement the output override flag (%TCOCO).  *Note O: A/4/e.
581 ^_Q     Set "query mode" (%TCQRY).  *Note Q: A/4/g.
582 ^_R     Set "refuse mode" (%TCRFS).  *Note R: A/4/g.
583 ^_S     Slave a specified terminal.  *Note S: A/4/f.
584 ^_U     Complement conversion of to upper case (%TOCLC).
585           *Note U: A/3/d.
586 ^_Y     Say yes to a query.  *Note Y: A/4/b.
587 ^_Z     Say no to a query.  *Note Z: A/4/b.
588 ^_^     Complement scroll mode for job that has the tty.
589           *Note ^: A/3/b.
590 ^_^U    Clear input for this TTY.  This completely flushes what
591         is in the input buffer and is useful for getting rid of
592         unwanted typeahead.
593
594 \1f\f
595 File: ITSTTY,  Node: B,  Previous: A,  Up: Top,  Next: C
596
597 B. "CONTROL OF THE TTY".
598
599 A terminal that is a console may be used by any of the jobs in
600 its tree, but not all at once.  At any time, the terminal belongs
601 to a particular job, and for the most part only that job can use it.
602 Also, all input and output interrupts go to that job only.  If
603 any other job in the tree tries to use the tty for anything except
604 to type out, it will not
605 succeed (it may wait until it is allowed to use the tty, it may
606 get an interrupt, or its system call may simply fail, depending
607 on what the job is doing and on the setting of some bits in .TTY,
608 described below).  Permission to type out is controlled by a
609 separate mechanism.
610
611 The job that is allowed to use the tty is said to "have control
612 of the tty", or to "have the tty".  The .ATTY and .DTTY UUO's
613 allow control of the tty to be passed between the jobs in a
614 tree.
615
616 * Menu: 
617
618 * Who Has:      B/1     What determines who has the TTY
619 * ATTY:         B/2     .ATTY and .DTTY
620 * Permission:   B/3     Permission to type out
621 * .TTY:         B/4     The .TTY variable
622 * .CNSL:        B/5     The .CNSL variable
623 \1f\f
624 File: ITSTTY,  Node: B/1,  Previous: B,  Up: B,  Next: B/2
625
626  1. WHAT DETERMINES WHO HAS THE TTY.
627
628 Each job has a variable - called .TTY, readable with a .SUSET or
629 .USET - that says, among other things, whether it wishes to retain
630 the tty or to pass it on to a particular one of its inferiors.
631 Each job can alter that setting at any time.  The instantaneous
632 values of the .TTY variables of all the jobs in a tree determine
633 which of them has the tty, as follows: If the top level job wishes
634 to retain the tty, then it owns the tty; otherwise, if the one
635 inferior which it wishes to pass the tty on to wishes to retain
636 the tty, then that job owns the tty; otherwise the job that job
637 wishes to pass the tty on to has its chance, etc.  In other words,
638 at any instant the tty is as far down as it can get before being
639 blocked from further descent by a job that wishes to retain it.
640 \1f\f
641 File: ITSTTY,  Node: B/2,  Previous: B/1,  Up: B,  Next: B/3
642
643  2. .ATTY AND .DTTY.
644
645 .DTTY is used when a job decides that it wishes to retain the
646 tty.  It skips if it succeeds; it fails if the job was already in
647 the state of wishing to retain the tty,
648 If the tty had actually belonged to some (possibly
649 indirect) inferior, it will belong after the .DTTY to the job
650 that executed it.
651
652 The ATTY operation puts the job in the state of wishing to pass
653 control of the tty to one of its direct inferiors.  This is known
654 as an "ATTY'ing state".  If a job which is in an ATTY'ing state
655 is allowed ownership of the TTY by its superiors (ie, they too are
656 in ATTY'ing states pointing down to this job), then ownership
657 passes yet another level to the ATTY'd inferior.
658 Whenever an ATTY is done, the %TSATY bit will be set to 1 in TTYSTS,
659 and the inferior receiving the tty will be given a %PIATY
660 interrupt if it is enabled.
661
662 The ATTY operation can be done with either the .ATTY UUO or the ATTY
663 symbolic system call.  .ATTY <chn>, specifies the inferior open on
664 channel <chn>.  The ATTY symbolic system call takes one argument,
665 a job spec, to specify the inferior to ATTY to.
666
667 ATTY'ing is illegal for the job which has the tty, when the %TSLCZ
668 bit is set (meaning that the last char typed on the tty was "^Z").
669 This is a half-hearted attempt to make it possible to "^Z" up
670 several levels past programs that are trying to prevent that.
671 Since super-image input mode now exists, such an attempt is futile.
672 This "feature" can probably be flushed if anyone wishes.
673
674 The "\eP" command causes DDT to do an .ATTY, among other things.
675 "^P" does not.  DDT does a .DTTY when an "\eP"'ed job returns to DDT.
676
677 A job need not have the tty to do an .ATTY or .DTTY.  In fact, they
678 are the only operations on ttys that work as well without the tty
679 as with it.
680 \1f\f
681 File: ITSTTY,  Node: B/3,  Previous: B/2,  Up: B,  Next: B/4
682
683  3. PERMISSION TO TYPE OUT.
684
685 The job that owns the TTY, and the job at the top of the tree,
686 can always type out on the TTY.  Those jobs can also grant
687 permission to some of their inferiors, which can in turn grant
688 it to their inferiors, and so on.  Such indirect permission
689 is controlled by two bits in the .TTY variable of each job.
690 One bit, %TBOUT, is set by the superior to 1 to grant permission, or
691 to 0 to deny it, to the job whose %TBOUT bit it is.  The other,
692 %TBINF, if set to 0, denies all inferiors permission to type out
693 without forgetting the states of their %TBOUT's.  A job inherits
694 type-out permission from its superior only if its own %TBOUT and the
695 superior's %TBINF are both 1.  A job has type-out permission iff a
696 chain of inheritance reaches up from it to the top of the tree or to
697 the job which owns the TTY. 
698
699 The DDT command \e\e^P works by means of this feature.
700 \1f\f
701 File: ITSTTY,  Node: B/4,  Previous: B/3,  Up: B,  Next: B/5
702
703  4. THE .TTY VARIABLE.
704
705 This variable is actually called TTYTBL in the system.
706 "%TB" and "$TB" identify bits and fields in the TTYTBL variable,
707 which contains the information on the status of a job
708 with respect to its console tty (if any).  Note that it is not
709 necessary for a job to belong to a tree that has a tty for these
710 bits to make sense.  The $TBECL field is actually a shadow location
711 for a per-tty/per-job variable; it only contains real information
712 when the job does NOT have the tty.
713
714 Most of the fields are set only by the system, but %TBNVR and
715 %TBINT are user options, settable by .SUSET or .USET.  They
716 decide what the job will do when it tries to use the tty, but
717 doesn't have it.
718
719 %TBNOT==400000  ;4.9 1 iff the job does not have the tty.
720 %TBNVR==200000  ;4.8 1 => opens of TTY: should fail when
721                 ;the job does not have the tty.
722 %TBINT==100000  ;4.7 1 => all attempts to use the tty when
723                 ;the job doesn't have the tty, should cause class 2
724                 ;interrupts on bit 4.2 (%PJTTY) of the first interrupt word.
725                 ;0 => such attempts wait until the job gets the tty.
726 %TBWAT==040000  ;4.6 1 => override the settings of %TBNVR and
727                 ;%TBINT, and always wait for the TTY.  This bit can
728                 ;be set only by the job's superior, and means "you
729                 ;are supposed to have the TTY, even though for a
730                 ;short interval you may not really have it".
731 %TBDTY==010000  ;4.4 1 iff job doesn't have tty, but wishes
732                 ;to retain it.  Set by .DTTY, cleared by .ATTY.
733 %TBOUT==004000  ;4.3 1 => this job can inherit type-out permission
734                 ;from its superior (can be altered only by superior).
735 %TBINF==002000  ;4.2 1 => inferiors are allowed to inherit type-out
736                 ;permission from this job.
737 $TBECL==220600  ;3.1 - 3.6 the job's setting of the number of
738                 ;lines in the echo area, if the job doesn't have
739                 ;the tty.
740 RH:             ;If the job has the tty, this is the tty number.
741                 ;If the job is in an .ATTY'ed state, this has the
742                 ;internal user index of the inferior the tty
743                 ;should be passed on to.
744                 ;Otherwise, 0.
745 \1f\f
746 File: ITSTTY,  Node: B/5,  Previous: B/4,  Up: B        
747
748  5. THE .CNSL VARIABLE.
749
750 If a program needs to know the number of its tree's tty (or of
751 some other job's tree's tty), it can get that information
752 without actually possessing the tty by reading the .CNSL
753 user variable.  That variable contains the number of the
754 tree's tty if there is one;  -1 for a job scheduled as part
755 of the system;  -2 for a job scheduled as a disowned job.
756 for a job device or its inferior, .CNSL will be the same as
757 for the creator of the job device.
758 \1f\f
759 File: ITSTTY,  Node: C,  Previous: B,  Up: Top,  Next: D
760
761 C. OPENING TTY CHANNELS.
762
763 Terminals may be opened for I-O using either device TTY: or device
764 Tnm:.  TTY should be used by a job in a console-controlled tree to
765 open the console.  Tnm should be used to open a terminal "as a
766 device" - that is, to open a tty that is not the console of the
767 job doing the opening.
768
769 * Menu:
770
771 * Opening:      C/1     Opening "TTY:" and "Tmn:"
772 * Bits:         C/3     Device-dependent bits in the OPEN mode
773 \1f\f
774 File: ITSTTY,  Node: C/1,  Previous: C,  Up: C,  Next: C/3
775
776  1. OPENING "TTY".
777
778 Device TTY may only be successfully opened by a job in a console-
779 -controlled tree which is in posession of the tty.  If a job which
780 does not meet that criterion tries to open the tty, the open may
781 hang, fail, or generate a fatal interrupt, depending on the setting
782 of the %TBNVR and %TBINT bits of the job (*Note NoTTY: B/3.).
783 What such an open will definitely not do is succeed.
784
785  2. OPENING "Tnm".
786
787 Opening device Tnm is the way for a program to make use of a tty
788 other than its console (in fact, it need not have a console).
789 "nm" should be replaced by the two-digit octal number of the terminal
790 to be used.  In order for the opening of device Tnm to succeed,
791 the specified terminal must not be in use by any other job.
792 An attempt to open by number a tty which happens to be the console
793 of the job doing the open will succeed iff the job has the tty at
794 the time.  This is to make it possible to specify one's own tty when
795 asked to specify a tty by number.
796 \1f\f
797 File: ITSTTY,  Node: C/3,  Previous: C/1,  Up: C,  Next: D
798
799  3. DEVICE-DEPENDENT BITS IN THE OPEN MODE.
800
801 Many of the bits in the mode specified in a .OPEN have special
802 meanings for devices TTY and Tnm.  Some of them affect only the
803 channel being opened; others merely initialize some of the per-tty/
804 per-job information, but those bits are
805 effective only if the terminal is not open in the same direction on
806 any other channel (those bits exist for historical reasons only,
807 since the variables they set may be set explicitly at any time
808 using the TTYSET and SCML symbolic system calls (*Note vars: G.)).
809
810 The per-channel bits which have names are used only to initialize
811 the IOCHNM word of the channel - thus, mode bit 4.6 (%TIECH) is
812 copied into bit 4.6 of the IOCHNM word.  Various I-O operations
813 examine the IOCHNM word to decide what to do.  With symbolic system
814 call IOT's, the user may temporarily alter the settings of those
815 bits, so the values supplied in the open are merely the defaults
816 for the channel.
817
818 The per-channel bits that are not named are
819 interpreted by the OPEN routine, and act by setting some of the
820 named bits, as described below.  They exist for historical reasons.
821 (that does not include bits 3.1 and 3.2, which are special).
822
823 * Menu:
824
825 * Bits:         C/3/a   Per-channel bits
826 * Other:        C/3/b   Other Per-channel bits on input and output
827 * First:        C/3/d   First-time bits on output and input
828 \1f\f
829 File: ITSTTY,  Node: C/3/a,  Previous: C/3,  Up: C/3,  Next: C/3/b
830
831   a. Per-channel Bits.
832
833 3.1     1 => output; 0 => input.  Affects the interpretation of the
834          other bits.
835 3.2     1 => block mode; 0 => unit mode.  In block mode, each
836          character is treated as in unit mode, except that on output,
837          "^C" is ignored, and on input, "^C" typed in will act like
838          end-of-file (that is, the .IOT will return with the last
839          word padded out with "^C"'s and the pointer not fully
840          counted out).  "^C" also terminates SIOT's on unit input
841          channels, but it is not ignored by output SIOT's.
842 \1f\f
843 File: ITSTTY,  Node: C/3/b,  Previous: C/3/a,  Up: C/3,  Next: C/3/d
844
845   b. Other Per-channel Bits on Input.
846
847 %TIECH==40000   ;1 => can read even if char needs pi echoing.
848 %TIPEK==20000   ;1 => don't remove char from buffer.
849 %TIACT==4000    ;1 => don't wait for activation character.
850 %TIINT==2000    ;1 => can read a char even if it is supposed to interrupt & hasn't yet.
851 %TINWT==1000    ;1 => do not wait for input.  If no input is available,
852                 ;unit mode IOT's return -1; unit mode SIOT's and block mode
853                 ;IOT's return without filling up the space available to them.
854 %TIFUL==400     ;1 => use the full TV character set if possible.
855                 ;suppresses the conversion, which is normally
856                 ;performed on TV's, from the TV character set
857                 ;to ascii.  See ITS TV.
858
859
860   c. Other Per-channel Bits on Output.
861
862 3.4             1 => turn on %TJECH, %TJPP2, and %TJMOR.
863 3.5             1 => turn on %TJDIS.
864 3.6             1 => turn on %TJSIO.
865 %TJECH==40000   ;1 => echo mode output (all chars output the
866                 ;way they would be echoed)
867 %TJCTN==20000   ;1 => don't do line-continuation.
868 %TJSTP==10000   ;1 => this channel is hung in **more**.
869                 ;this bit is unusual in that the system changes it
870 %TJDIS==4000    ;1 => recognize "^P" as an escape for display commands
871 %TJSIO==2000    ;1 => superimage output, no padding or cursor control.
872 %TJMOR==1000    ;1 => don't do **MORE** processing.
873 %TJPP2==400     ;1 => output in the echo area if there is one.
874 \1f\f
875 File: ITSTTY,  Node: C/3/d,  Previous: C/3/b,  Up: C/3  
876
877   d. First-time Bits on Output.
878
879 3.3     1 => image mode (set all %TGIMG bits in TTYST1 and TTYST2)
880         If you think you want to do this, you probably
881         really want to use %TJSIO.
882
883   e. First-time Bits on Input.
884
885 3.3     1 => image mode (clear all %TGPIE and %TGMPE bits in TTYST1, TTYST2).
886         It is UNWISE TO USE THIS FEATURE, because it will prevent the
887         user from translating TTY: to a file of commands for your
888         program.  You should use a TTYGET and TTYSET to change these
889         bits, and you should not complain if they fail.
890 3.4     1 => "DDT" (clear %TGPIE and %TGMPE bits for CR, LF and TAB)
891 3.6     1 => want 3 lines in echo area.
892          (that is, the OPEN should do a SCML with argument 3.
893           *Note SCML: E/4.).
894 \1f\f
895 File: ITSTTY,  Node: D,  Previous: C,  Up: Top,  Next: E
896
897 D. INPUT FROM TERMINALS.
898
899 Characters typed on a terminal, aside from those that invoke the
900 CALL and ESCAPE functions, go into an input buffer from which
901 they may eventually be read by the program (if the buffer is
902 full, they are discarded, and a "^G" is output).  Before being
903 read, they may be echoed (and usually will be).  A character may
904 also cause an input interrupt - this allows specific characters
905 to signal a program to perform some action immediately, at any
906 time, without waiting for the program to get around to looking
907 for input.
908
909 If %TOALT is set, and %TSALT is not, characters 175 and 176 will
910 be turned into 33 (this is "standardization of altmodes").
911
912 * Menu:
913
914 * Echo:         D/1     Echo
915 * MP Input:     D/2     Main-program input.
916 * Activation:   D/3     Activation.
917 * Interrupts:   D/4     Input interrupts.
918 * Throw:        D/5     Throwing away type-in.
919 * Avail:        D/6     Testing for the availability of input.
920 * .STATUS:      D/7     .STATUS on tty input channels.
921 * Char Set:     D/8     The character set
922 \1f\f
923 File: ITSTTY,  Node: D/1,  Previous: D,  Up: D,  Next: D/2
924         
925  1. ECHO.
926
927 "Echoing" is the act of typing out whatever the user types in.
928 Its purpose is to give the user positive verification of his
929 type-in.  On ITS, echoing works by taking the typed-in characters
930 and outputting them in echo mode, in the echo area if there is
931 one (that is, outputting with %TIECH and %TIPP2 set).  There are
932 two types of echoing: PI echoing, and MP (main program) echoing.
933 PI echoing happens as soon as possible after the character is
934 typed in.  MP echoing happens when the character is read in by
935 the program.  Each program may specify which characters ought to
936 be PI echoed, and which ought to be MP echoed, using the
937 per-tty/per-job variables TTYST1 and TTYST2 (specifically, the
938 %TGPIE and %TGMPE bits, of each of which there is one for each
939 group).  It is permitted to specify that a character not be echoed
940 at all, or that it be echoed in both ways (PI and MP).  Most
941 programs specify that all characters be PI echoed, and none MP
942 echoed; DDT choses to have LF and TAB not echoed at all; some
943 programs such as TELNET and PDP11 in certain modes turn off all
944 echoing.  MP echoing is not used much if at all, and is not
945 clearly useful, so it may be flushed in the future, although if
946 an important use is found it will stay.  Therefore, new programs
947 should avoid using MP echo if possible.  If use of it is
948 very desirable, please :BUG ITS the application.
949
950 Normally, a character cannot be read in until any necessary
951 echoing has taken place.  However, if reading is done with the
952 %TIECH bit set, any echoing (of the characters thus read) not
953 yet performed will be skipped entirely.  This does not guarantee
954 that such characters will not be PI echoed; it just means that
955 the system will not regard the PI echoing as essential, and will
956 forgo it rather than wait for it.  MP echoing will certainly not
957 be done for characters read with %TIECH set.  Extra bits will be
958 returned with such characters saying what kinds of echoing were
959 appropriate but were not yet done, to enable the program to echo
960 the character itself if that is right.  The bits are
961 %TXPIE=200000 saying PI echo was desired, and %TXMPE=400000
962 saying MP echo was desired.
963
964 The bit %TSNOE in the TTYSTS variable (*Note TTYSTS: G/1/b.), when set
965 to 1, causes echoing to be deferred; that is, echoing will not be
966 performed while the bit is set, but the system still remembers what
967 echoing is pending, and will again start doing it when %TSNOE becomes
968 0.  However, if a character with pending echoing is read in while
969 %TSNOE is 1, the pending echoing will of necessity be forgotten.  When
970 %TSNOE is 1, the system acts as if %TIECH were 1 on all input IOT's
971 from that tty, since otherwise such IOT's wuld simply wait forever. 
972 In particular, the %TXPIE and %TXMPE bits in the character read will
973 tell the user what sorts of echoing were still pending. 
974
975 \1f\f
976 File: ITSTTY,  Node: D/2,  Previous: D/1,  Up: D,  Next: D/3
977
978  2. MAIN-PROGRAM INPUT.
979
980 Characters are read from the tty using the .IOT UUO or the
981 symbolic system calls IOT or SIOT.
982 .IOT has slightly less overhead, but the symbolic system calls
983 allow the channel's characteristics to be temporarily altered.
984
985 Unit mode IOT's read a single character and return it.  SIOT's and
986 block mode IOT's try to read enough characters to fill the block
987 supplied, but the character "^C" will cause them to return what
988 has been read so far, with pointers and counts not fully advanced.
989 SIOT and block mode IOT input from ttys is relatively useless;
990 it is provided for the sake of device-independence.  Programs
991 should normally read from the tty in unit mode.
992
993 IOT'ing on the job's console cannot actually be done unless the
994 job has control of the console (*Note Owner: B.).  If it does not,
995 either the IOT will wait until the job gets the tty, or a class 2
996 interrupt will result, depending on the %TBINT and %TBWAT
997 bits in .TTY (*Note NoTTY: B/3.).
998 Also, on any tty, IOT's will wait until either the tty is
999 not in a com link, or the tty is slaved, or %TCICO is set
1000 (*Note Com: A/4/e.).
1001
1002 Input IOT's executed when the input buffer is empty will
1003 normally wait until input is available (*Note Wait: D/3.).  However,
1004 if %TINWT is set, the IOT will not wait at all.  Instead, unit mode
1005 IOT's will immediately return -1; SIOT's and block mode IOT's
1006 will return with the supplied block not completely filled
1007 and the pointer and count advanced to point to the first
1008 unfilled character or word.
1009
1010 When an IOT attempts to read a character, if PI echoing is
1011 necessary for the character and has not been performed, the IOT
1012 waits until it has been (unless %TIECH is set, or %TSNOE is
1013 set).  Also, if the character is supposed to cause an input
1014 interrupt, the IOT waits until the character has been processed
1015 at interrupt level with .ITYIC (unless %TIINT is set or .PICLR
1016 holds 0 preventing interrupts from occurring).  In that case, the
1017 interrupt will normally occur as soon as the IOT hangs up, and
1018 if the interrupt routine dismisses normally, the IOT will then
1019 be able to read the character.
1020
1021 When any necessary PI echoing or interrupting is finished, the
1022 IOT performs MP echoing if necessary and not yet done (unless
1023 %TIECH is set, or %TSNOE is set).  The character is then removed
1024 from the input buffer and returned to the user (but if %TIPEK is
1025 set, the character is left in the input buffer, so that the next
1026 IOT will re-read it).  If echoing that normally
1027 would have been required before the IOT could return has been
1028 omitted because of %TIECH or %TSNOE, the following extra bits
1029 will be returned along with the character read (in unit mode
1030 only): %TXPIE = 200000 meaning that PI echo would have been
1031 done, and %TXMPE = 400000 meaning that MP echoing would have
1032 been done.
1033
1034 It is at this point, when the character is about to be returned
1035 to the user, that conversion from the TV character set to ascii
1036 is done unless the %TIFUL bit is set.  This conversion happens on
1037 all terminals but it has no effect on characters which are
1038 already ascii,as all characters are if the terminal is not a TV.
1039
1040 The way symbolic system call IOT's and SIOT's change the settings
1041 of the per-channel bits is with the control-bit argument, which is
1042 XOR'ed into the IOCHNM word at the beginning and end of the IOT.
1043 Thus, if %TIACT is normally 0, and it is desired to read one
1044 character with %TIACT set to 1, the following call may be used:
1045         .CALL [ SETZ
1046                 'IOT,,
1047                 1000,,TYIC      ;CHANNEL.
1048                 AC              ;CHARACTER READ GOES IN AC.
1049                 405000,,%TIACT] ;IMMEDIATE CONTROL-BIT ARGUMENT.
1050          .VALUE
1051         ...                     ;CHARACTER NOW IN AC.
1052 Note that the IOT does not change the settings permanently; to
1053 do that, the channel must be reopened.  The specified bits are
1054 changed only for the duration of the IOT that specifies them.
1055
1056 \1f\f
1057 File: ITSTTY,  Node: D/3,  Previous: D/2,  Up: D,  Next: D/4
1058
1059  3. ACTIVATION.
1060
1061 An input IOT will, for an unclever program, unhang as soon as there
1062 is any character to be read in.  However, it may be known that a
1063 particular program never needs to respond to type-in until a character
1064 from some small set (such as CR and rubout; for TECO, altmode,
1065 rubout and "^C") has been typed in.  Such programs may lighten the
1066 scheduling and swapping load on the system by saying that other
1067 characters should not be "activation characters".  Then an IOT will
1068 usually not unhang unless at least one activation character
1069 has been typed in.  Note that no lossage will occur if a character
1070 that need not activate does so.  Also, some other conditions cause
1071 activation.
1072
1073 The set of activation characters is specified using the %TGACT bits
1074 in the TTYST1 and TTYST2 variables.  Initially, all of them are 1,
1075 meaning that all characters should activate.
1076
1077 A program may be able to get away with a small set of activation
1078 characters except in a few special circumstances (for example,
1079 TECO needs to be able to respond immediately to a "?" typed as
1080 the first character when a command string is expected, but most of
1081 the time a "?" requires no immediate response).  The
1082 program may then specify that small set for activation, and when
1083 the unusual circumstances arise, it can do input in a special
1084 way that does not wait for activation, either by IOT'ing with the
1085 %TIACT bit set to 1, or by setting %TSACT to 1 before each character
1086 is read.  Both of those bits mean "activate on any character".  Note
1087 that %TSACT is cleared after each character, so setting it only
1088 affects the next attempt to do input.  %TIACT may be set temporarily
1089 using a symbolic system call IOT.
1090
1091 \1f\f
1092 File: ITSTTY,  Node: D/4,  Previous: D/3,  Up: D,  Next: D/5
1093
1094  4. INPUT INTERRUPTS.
1095
1096 A program may enable an interrupt to occur whenever a character
1097 is typed in.  In the simplest case, any character will cause an
1098 interrupt, but the program may prevent uninteresting characters
1099 from interrupting by clearing their %TGINT bits in TTYST1 and
1100 TTYST2.  There are two kinds of interrupts that may be enabled.
1101 If the tty is a console, bit 1.1 (%PITYI) in the first interrupt
1102 word may be enabled.  This bit is obsolete and should be avoided.
1103 For any tty, whether console or device, an interrupt may be enabled
1104 on one of the input channels - in which case an interrupt will be
1105 signaled on one and only one of the enabled channels.  Both kinds
1106 of interrupt are class 3.
1107
1108 Most programs normally read their input at main program level,
1109 and want only a few characters to be processed at interrupt level.
1110 Such programs need to be able to examine the character which caused
1111 the interrupt.  IOT'ing it will not do, for other non-interrupting
1112 characters may have been typed in before the interrupt character,
1113 and not read yet at main program level.  ITS provides a special
1114 mechanism for doing this: .ITYIC, which reads the next
1115 not-yet-.ITYIC'ed interrupt character.  The program should execute
1116 .ITYIC for each tty input interrupt to see what character caused it.
1117 The calling sequence is:
1118         MOVEI AC,CHANNEL
1119         .ITYIC AC,
1120          JRST GIVEUP     ;PRETEND THIS INTERRUPT HADN'T HAPPENED.
1121         ...             ;CHARACTER NOW IN AC.
1122 The .ITYIC will skip if it succeeds; it can fail if the channel
1123 number is bad or does not have a tty open, if the tty is the job's
1124 console but does not belong to this job at the moment, or because
1125 no interrupt character is available.  It can also cause a class 2
1126 interrupt if the %TBINT bit is set and the job does not have the
1127 tty.
1128
1129 .ITYIC is actually a special case of the WHYINT generic system call.
1130 Doing a WHYINT on a TTY input channel will return %WYTYI as the first
1131 value and the character which caused the interrupt as the second.
1132 WHYINT was invented by generalizing .ITYIC to other sorts of devices.
1133 Thus, .ITYIC is actually semi-obsolete, but everyone still uses it.
1134
1135 The program should ignore any interrupt caused by a character
1136 that isn't supposed to interrupt (due to timing screws and
1137 moving the tty from one job to another that can happen).  It
1138 should also ignore an interrupt if the .ITYIC doesn't skip
1139 (that can happen if DDT took the tty away and flushed the input
1140 between the interrupting and the .ITYIC'ing).
1141
1142 If the interrupt routine decides that it needs to examine the
1143 next character also, it can set %TSINT to 1.  That will cause the
1144 following character to interrupt even if it normally wouldn't
1145 (TECO uses this to distinguish a solitary altmode from a pair of
1146 altmodes at interrupt level).  This feature will work regardless
1147 of whether that "following" character has already been typed in.
1148
1149 .ITYIC'ing does not eliminate the need to IOT the character - it
1150 is specifically designed not to interfere with the expected later
1151 IOT'ing of the character.  If the interrupt character is supposed
1152 to have no effect except for the interrupt, then it must be
1153 ignored explicitly when IOT'ed.  Alternatively, the character can
1154 be flushed explicitly from the input stream by using the TTYFLS
1155 symbolic system call (see ITS .CALLS).
1156
1157 It is not necessary for the interrupt handler to keep .ITYIC'ing
1158 until no more characters are available, because a separate
1159 interrupt will occur for each character that should cause one.
1160
1161 An alternative to .ITYIC'ing at interrupt level and IOT'ing at
1162 main program level, is IOT'ing at interrupt level.  This works
1163 reasonably as long as it is convenient for the program (for
1164 example, PEEK does this).  The program can even IOT the characters
1165 at interrupt level and keep its own buffers for its main program
1166 level if it wishes to.  If the characters are
1167 IOT'ed when they interrupt, there is no need to .ITYIC them.
1168 However, all characters must be set to cause interrupts, or the
1169 interrupts might get one off from the IOT's.
1170 \1f\f
1171 File: ITSTTY,  Node: D/5,  Previous: D/4,  Up: D,  Next: D/6
1172
1173  5. THROWING AWAY TYPE-IN.
1174
1175 If a .RESET UUO or a RESET symbolic system call is done on a
1176 tty input channel, any input in the input buffer will be thrown
1177 away.  If any of the characters being discarded has not echoed,
1178 or has not interrupted, then it never will.
1179
1180 \1f\f
1181 File: ITSTTY,  Node: D/6,  Previous: D/5,  Up: D,  Next: D/7
1182
1183  6. TESTING FOR THE AVAILABILITY OF INPUT.
1184
1185 A program may find out how much input is available using the UUO
1186 .LISTEN or the symbolic system call LISTEN.  Both wait for the
1187 output buffer to empty, and then return the number of characters
1188 in the input buffer (To check for input without waiting for output
1189 to finish, use .STATUS - see below).
1190 .LISTEN AC, applies only to the job's console,
1191 and returns its value in AC.  If the job has no console, or doesn't
1192 have its console at the moment, 0 is returned.
1193 The symbolic LISTEN call takes a tty
1194 channel as an argument and returns a value in the usual way.
1195 The call will fail if the channel number is bad, if the channel does
1196 not have a tty open, or if the tty is the job's console but the
1197 job doesn't own it at the moment.  It will skip iff it succeeds.
1198         .CALL [ SETZ
1199                 'LISTEN
1200                 1000,,CHANNEL
1201                 402000,,FOO]    ;PUTS # CHARS. IN FOO.
1202          JRST NOTTY             ;I WAS ^P'D BY DDT.
1203         ...                     ;FOO NOW SET UP.
1204
1205 \1f\f
1206 File: ITSTTY,  Node: D/7,  Previous: D/6,  Up: D,  Next: D/8
1207
1208  7. .STATUS ON TTY INPUT CHANNELS.
1209
1210 A .STATUS or symbolic system call STATUS executed on a tty
1211 channel returns either 1 or 2 as the device type code - 2 if the
1212 tty is a display with selective erase (%TOERS is set); 1, otherwise.
1213 Bit 2.1 will be 1 iff the tty's input buffer is full; bit 2.2 will
1214 be 1 iff the buffer is empty.  Thus, .STATUS on an
1215 input channel is a way of testing for the availability of input
1216 without waiting for the output buffer to empty out.  Bit 2.4 will be
1217 1 if the job currently owns its console.  Bit 2.5 will be 1 iff the
1218 number of characters available for IOT'ing is different from the
1219 number available for interrupt level processing (I am not sure why
1220 this bit exists).  Bit 2.8 will be 1 iff the terminal is located
1221 next to the 340 display or one of its slaves (it will always be
1222 0 except on the AI KA-10 machine).  Bit 2.9 will be 1 iff the terminal
1223 is "local" - that is, near the machine itself (only local ttys
1224 are allowed to use the LPT directly, for example).
1225 \1f\f
1226 File: ITSTTY,  Node: D/8,  Previous: D/7,  Up: D        
1227
1228  8. THE CHARACTER SET
1229
1230 This section describes the 12-bit input character set.  Terminals
1231 with the %TOFCI TTYOPT bit set can generate all of these.  Other
1232 terminals can only generate the ascii subset.
1233
1234 An input character consists of 7 bit of ascii character and 4 modifier
1235 bits.  Note that the ascii codes from 0-37, if generated by a
1236 non-%TOFCI terminal, are control characters, but if generated
1237 by a %TOFCI terminal are either special keys (like RETURN)
1238 or are "SAIL" printing characters in which case they appear in
1239 combination with %TXTOP.  TECO ORDER has more information on this.
1240
1241 The modifier bits are:
1242
1243         %TXTOP  Indicates that the TOP key was held down (usually).
1244                 Can also indicate some special characters (see below).
1245         %TXCTL  Indicates that the CTRL key was held down.
1246         %TXMTA  Indicates that the META key was held down.
1247         %TXSUP  Indicates that the SUPER key was held down.
1248                 (This used to mean that the SHIFT key was held down.)
1249
1250 Numerically, %TXTOP=4000, %TXCTL=200, %TXMTA=400, and %TXSUP=1000.
1251 %TXASC=177 is a mask for the 7-bit ascii basic character.
1252
1253 Note that the TOP key also modifies the ascii character
1254 code, but CTRL and META are simply added in.
1255
1256 Some special keys are indicated by %TXTOP plus the ascii code for
1257 a capital letter.  These can also be combined with %TXCTL, %TXMTA and %TXSUP.
1258
1259         %TXTOP+A        ESCAPE.  Note that the ESCAPE key is used to send commands
1260                         to the terminal controller (see ITS TV), so it cannot
1261                         be sent to the system except with CTRL or META.
1262         %TXTOP+B        BREAK.  Recommended as the character for "getting out of"
1263                         programs where CALL is not what you want.
1264         %TXTOP+C        CLEAR.
1265         %TXTOP+D        circle-minus.  An unassigned printing character key.
1266         %TXTOP+E        circle-plus.  An unassigned printing character key.
1267         %TXTOP+F        delta.  An unassigned printing character key.  (shift circle-minus)
1268         %TXTOP+G        del.  An unassigned printing character key.  (shift circle-plus)
1269         %TXTOP+H        Help key (top H).  Recommended for getting help.
1270                          This code is unusual in that it is passed to the
1271                          program as %TXTOP+H even when %TIFUL is not set.
1272         %TXTOP+Z        Internal code for deferred call.
1273
1274 Other special keys, which generate codes in the ascii controls region
1275 and without %TXTOP, are:
1276
1277         10      Backspace
1278         11      Tab
1279         12      Line
1280         13      VT
1281         14      Form (recommended for clear and redisplay the screen)
1282         15      Return (recommended for end of line)
1283         37      Back-next (used for input escape, *Note Escape: A.)
1284         33      Altmode
1285         177     Rubout (recommended for character deletion)
1286
1287 Some of these have printed representations on output.  Backspace, Tab,
1288 Line, and Return are format effectors.  Altmode is a printing character.
1289 \1f\f
1290 File: ITSTTY,  Node: E,  Previous: D,  Up: Top,  Next: F
1291
1292 E. OUTPUT TO TERMINALS.
1293
1294 The most basic forms of I-O are oriented toward stream-like devices.
1295 In fact, the ideal terminal is no longer a stream-like device but a
1296 random-access device - a display.  Ordinarily, access proceeds
1297 sequentially using a pointer called the cursor.  For more interesting
1298 operations, a set of display commands are provided to move the cursor
1299 or erase sections of the screen in ways independent of the hardware
1300 characteristics of the particular display in use, as long as the
1301 display has the ability to perform the specified function at all.
1302 There are also bits in the TTYOPT variable, which may be read with the
1303 CNSGET symbolic system call, that give information on which functions
1304 the particular terminal can perform.
1305
1306 * Menu:
1307
1308 * Output:       E/1     How to cause characters to be output.
1309 * Normal:       E/2     Normal output (sequential access).
1310 * Display:      E/3     Display-mode channels.  ^P-codes.
1311 * Echo:         E/4     The echo area.
1312 * Cursorpos:    E/5     Reading the cursor position.
1313 * Super:        E/6     Superimage output.
1314 * TTYOPT:       E/7     Relevant TTYOPT bits.
1315 * Flush:        E/8     Throwing away typeout.
1316 * Waiting:      E/9     Waiting for output to be sent to the terminal.
1317 * .STATUS:      E/10    .STATUS on tty output channels.
1318 \1f\f
1319 File: ITSTTY,  Node: E/1,  Previous: E,  Up: E,  Next: E/2
1320
1321    1. HOW TO CAUSE CHARACTERS TO BE OUTPUT
1322
1323 User programs output characters by means of the .IOT UUO or the
1324 symbolic system calls IOT or SIOT.  .IOT is pretty much equivalent to
1325 symbolic IOT, but has slightly less overhead and is less flexible.
1326 Display commands, which are several characters long, are output
1327 by outputting in order the characters that compose them.
1328 Unit mode channels may be used to output single characters with
1329 IOT, or to output packed strings of characters with SIOT.
1330 Since SIOT is much more efficient, commonly used programs or programs
1331 doing much tty output should use it when possible.
1332
1333 Block mode is semi-obsolete.  On a block mode channel, IOT outputs
1334 a block of words, containing 5 characters each.  The character "^C"
1335 is totally ignored, making it possible to output other than a
1336 multiple of five characters.  Block mode IOT's have no advantage over
1337 SIOT's on unit mode channels.
1338
1339 The symbolic system calls IOT and SIOT allow the respecification of
1340 the values of several per-channel mode bits (all those given names
1341 starting with "%TJ" - *Note Bits: C/3/c.).  Unit mode IOT is somewhat
1342 slower than the .IOT UUO, but the same is not true for SIOT and block
1343 mode IOT.
1344
1345 From now on, all three ways of outputting a character will be referred
1346 as IOT'ing, since their differences have all been described above.
1347
1348 If the terminal is in a com link, output IOT's will hang up, unless
1349 %TCOCO (see "^_O") or %TCLFT (see "^_E") is set.  If the tty is the job's
1350 console, the IOT will not do its work unless the job has the
1351 tty; otherwise it may wait or it may interrupt (*Note NoTTY: B/3.).
1352 \1f\f
1353 File: ITSTTY,  Node: E/2,  Previous: E/1,  Up: E,  Next: E/3
1354
1355  2. NORMAL OUTPUT (SEQUENTIAL ACCESS).
1356
1357 The way terminal output works when display commands are not in use
1358 is that each ordinary character is printed where the cursor points,
1359 and advances the cursor over the positions that it occupies.
1360 Formatting characters such as CR, LF, TAB and BS act by moving the
1361 cursor in the appropriate way (that is, they are really display
1362 commands).
1363
1364 * Menu:
1365
1366 * How:          E/2/a   How the System Goes about Outputting.
1367 * Contin:       E/2/b   Continuation - the Result of Line-overflow.
1368 * Wrap:         E/2/c   Wraparound and Scrolling - the Results of Page-overflow
1369 \1f\f
1370 File: ITSTTY,  Node: E/2/a,  Previous: E/2,  Up: E/2,  Next: E/2/b
1371
1372   a. How the System Goes about Outputting.
1373
1374 The way the system outputs any particular character to the tty
1375 depends in general on the following factors: whether the relevant
1376 %TGIMG bit in the TTYST1
1377 or TTYST2 variable says that the character should be output in image
1378 mode (this is the only way those bits have an effect), whether
1379 the channel specifies output in echo mode, whether the terminal
1380 can print the SAIL character set, and sometimes on random TTYSTS
1381 bits.
1382
1383 Note that we are thinking of flushing the %TGIMG bits in TTYST1 and
1384 TTYST2.  If that is done, all output will be done "in ASCII mode".  If
1385 you want the effects described below for image mode, you should
1386 probably open a channel in superimage mode and use it at such times.
1387
1388 * Menu:
1389
1390 * Ascii:        E/2/a/1         ASCII Graphic Characters.
1391 * ^G:           E/2/a/2         "^G".
1392 * CR:           E/2/a/3         Carriage-return.
1393 * LF:           E/2/a/4         Linefeed.
1394 * Tab:          E/2/a/5         Tab.
1395 * ^L:           E/2/a/6         Control-L (Formfeed).
1396 * Altmode:      E/2/a/7         Altmode.
1397 * ^P:           E/2/a/8         Control-P, the escape code.
1398 * BS:           E/2/a/9         Backspace.
1399 * Random:       E/2/a/10        Random Control Characters, and Rubout.
1400 \1f\f
1401 File: ITSTTY,  Node: E/2/a/1,  Previous: E/2/a,  Up: E/2/a,  Next: E/2/a/2
1402
1403    1: ASCII Graphic Characters.
1404
1405 These characters are simply sent to the terminal.  The system
1406 assumes that they will occupy one printing position, and move
1407 the terminal's hardware cursor one place to the right.
1408
1409 \1f\f
1410 File: ITSTTY,  Node: E/2/a/2,  Previous: E/2/a/1,  Up: E/2/a,  Next: E/2/a/3
1411
1412    2: "^G".
1413
1414 "^G" is assumed to make a noise or other temporary indication,
1415 occupy no space on the screen, and not move the cursor.
1416
1417 \1f\f
1418 File: ITSTTY,  Node: E/2/a/3,  Previous: E/2/a/2,  Up: E/2/a,  Next: E/2/a/4
1419
1420    3: Carriage-return.
1421
1422 If the channel specifies echo mode, a "CRLF" will be done.
1423 That is, the results will be the as if a CR and a LF had
1424 been output in image mode.
1425 Otherwise, if the TTYST2 variable specifies that CR is output
1426 in ascii mode, a "CRLF" will be done just the same, except
1427 that a bit will be set so that if the next character output
1428 to the tty is a LF, it will be ignored.  Thus, in ascii mode,
1429 a CR without a LF is the same as a CR with one LF.
1430 If CR is output in image mode, it moves the cursor to the
1431 beginning of the line it was on.  The line is not cleared.
1432 However, this feature will eventually be flushed, so you should not
1433 use it.  Instead, simply output ^PH^H to do a "stray CR".  In fact,
1434 you can output all your CR's this way.  For CR's which are not stray,
1435 this will not cause any trouble, and for those which are stray, it
1436 will cause the desired overprinting.
1437 \1f\f
1438 File: ITSTTY,  Node: E/2/a/4,  Previous: E/2/a/3,  Up: E/2/a,  Next: E/2/a/5
1439
1440    4: Linefeed.
1441
1442 If a LF follows a CR that was output in ascii mode and not
1443 in echo mode, the LF is ignored.  Otherwise, the LF is output
1444 in one standard way regardless of the settings of the several
1445 variables (but it is best to have TTYST2 specify ascii mode
1446 just in case image mode for LF ever means something).
1447 The action of LF is normally to move the cursor down one line.
1448 The horizontal cursor position is not changed by a LF.  On
1449 displays with selective erase (%TOERS is set) LF clears the
1450 line it moves down to.  The entire line is cleared even if
1451 the horizontal position is not zero.
1452 The bottom of the screen poses special problems for LF.
1453 If the LF reaches the lowest line on the screen, it may
1454 trigger **MORE** processing.  If it starts from the bottom line
1455 of the screen, it needs to wrap around or scroll (*Note Wrap: E/2/c.).
1456 \1f\f
1457 File: ITSTTY,  Node: E/2/a/5,  Previous: E/2/a/4,  Up: E/2/a,  Next: E/2/a/6
1458
1459    5: Tab.
1460
1461 If the channel specifies echo mode or TTYST2 specifies ascii
1462 mode, the tab causes the cursor to be moved rightward up to
1463 the next multiple of eight spaces from the left margin, or
1464 to the right margin if that comes first.  If continuation is
1465 not suppressed and the cursor starts out at the continuation
1466 column, continuation will be done and then the tab will be
1467 handled (note that when continuation is in effect, the right
1468 margin is the continuation column).
1469 If output is not in ascii mode or echo mode, a tab character
1470 is sent to the tty, and assumed not to move the cursor.
1471 \1f\f
1472 File: ITSTTY,  Node: E/2/a/6,  Previous: E/2/a/5,  Up: E/2/a,  Next: E/2/a/7
1473
1474    6: Control-L (Formfeed).
1475
1476 In echo mode, "^L" will normally echo as a clear screen
1477 ("^PC").  However, on printing ttys (ttys whose %TOMVU is off)
1478 or if the program has set %TSCLE (Control-L Echo) "^L" will
1479 echo like other random control characters (*Note Ctl: E/2/a/10.).
1480 Not in echo mode, "^L" is treated like other random
1481 control characters.
1482 \1f\f
1483 File: ITSTTY,  Node: E/2/a/7,  Previous: E/2/a/6,  Up: E/2/a,  Next: E/2/a/8
1484
1485    7: Altmode.
1486
1487 If the TTYST2 variable says that altmode should be output in
1488 ascii mode, or if the channel specifies echo mode, then
1489 normally a dollar-sign will be sent, but if the %TOSAI bit in
1490 the TTYOPT variable, which means "ASCII mode should use the
1491 SAIL character set" is on, an altmode will be sent (it comes
1492 out as a diamond on the screen).  In either case the cursor
1493 moves one position.
1494 If output is in image mode and not in echo mode, an altmode
1495 will be sent to the terminal.  It will be assumed not to move
1496 the cursor unless %TOSAI is set, meaning "the terminal
1497 understands the SAIL character set", in which case it will
1498 be assumed to move the cursor one space right.
1499 \1f\f
1500 File: ITSTTY,  Node: E/2/a/8,  Previous: E/2/a/7,  Up: E/2/a,  Next: E/2/a/9
1501
1502    8: Control-P.
1503
1504 "^P" is output like most other control characters (*Note Ctl: E/2/a/10.).
1505 However, on a channel open in display mode, "^P" serves as
1506 an escape prefix for display commands.  In order to output
1507 a "^P" using such a channel, the display command "^PP" must
1508 be used.
1509 \1f\f
1510 File: ITSTTY,  Node: E/2/a/9,  Previous: E/2/a/8,  Up: E/2/a,  Next: E/2/a/10
1511
1512    9: Backspace.
1513
1514 In echo mode on a terminal which can't backspace, "^H" echoes
1515 as uparrow-H.
1516 Otherwise, if in column 0, backspace does nothing.
1517 Otherwise, on an IMLAC, backspace sends a backspace, and
1518 assumes the cursor moves back one position.  On other types
1519 of terminals, backspace simply moves the cursor back one
1520 position.
1521 \1f\f
1522 File: ITSTTY,  Node: E/2/a/10,  Previous: E/2/a/9,  Up: E/2/a   
1523
1524    10: Random Control Characters, and Rubout.
1525
1526 If TTYST1 specifies ascii mode for these characters, or
1527 the channel specifies echo mode, then a control character
1528 will be sent as an uparrow followed by the appropriate
1529 graphic character (thus, "^A" as "^" followed by "A"),
1530 unless %TSSAI is set, in which case the control character
1531 itself will be sent, and the system will expect it to be
1532 a graphic that moves the cursor one position.
1533 If %TSSAI is 0 but %TOSAI is set, then a SAIL uparrow will
1534 be used instead of a "^" when typing the "^A".
1535 If not in ascii mode or echo mode, the control character
1536 itself will be sent, and the system will expect it not to
1537 move the cursor, unless %TOSAI is set, in which case it
1538 will be expected to move the cursor one space right.
1539 Note that this is just like the treatment of altmode
1540 except for the details of the conversion in the case
1541 of ascii or echo mode with %TSSAI not set.
1542 \1f\f
1543 File: ITSTTY,  Node: E/2/b,  Previous: E/2/a,  Up: E/2,  Next: E/2/c
1544
1545   b. Continuation - the Result of Line-overflow.
1546
1547 When typeout attempts to go past the right margin, the
1548 system inserts a "!" and a CRLF to make sure that output
1549 is not lost.  The last printing position on each line is
1550 normally reserved for the "!" printed when continuation
1551 is done, and the line size of the terminal as specified
1552 in or returned by system calls does not count that column.
1553 The act of continuation takes place when an attempt is made
1554 to output a character and the cursor is pointing at the
1555 reserved continuation column; the "!" and CRLF are output,
1556 followed by the character that provoked the continuation
1557 (which will be in the next line).
1558 Continuation may be suppressed by opening a channel with the
1559 %TICTN bit set; then characters output on that channel will
1560 never provoke continuation no matter where the cursor points.
1561 The continuation column is available for use by the program.
1562
1563 The display codes ^PX and ^PB "understand" continuation to some
1564 extent.  See their descriptions.
1565 \1f\f
1566 File: ITSTTY,  Node: E/2/c,  Previous: E/2/b,  Up: E/2  
1567
1568   c. Wraparound and Scrolling - the Results of Page-overflow.
1569
1570 When an attempt is made to linefeed past the bottom line of
1571 the screen, either the cursor wraps around or the screen scrolls
1572 up.  Which one happens depends on whether the terminal is in
1573 scroll mode, as determined by the setting of %TSROL.  That bit
1574 is stored per-tty/per-job, and may be set by the program with
1575 TTYSET, and complemented by the user with "^_^".  Its value
1576 is initialized from %TOROL in each job separately.  %TOROL is
1577 initialized whenever a tty begins to be used.  The initial
1578 value is 0 except on the dynamod machine.  %TOROL may be set
1579 with a CNSSET, or by the TCTYP program.
1580
1581 The echo area cursor never causes scrolling.  Whenever it reaches
1582 the bottom of the screen it wraps around to the top of the echo
1583 area, regardless of the setting of %TSROL.
1584
1585 * Menu:
1586
1587 * Scrolling:    E/2/c/1
1588 * Wraparound:   E/2/c/2
1589 \1f\f
1590 File: ITSTTY,  Node: E/2/c/1,  Previous: E/2/c,  Up: E/2/c,  Next: E/2/c/2
1591
1592    1: Scrolling.
1593
1594 Scrolling moves the contents of the screen up several lines
1595 (the number depends on the type of terminal) and then linefeeds
1596 normally.  Only some types of terminals can scroll; others will
1597 always wrap around even if scroll mode is on.
1598 \1f\f
1599 File: ITSTTY,  Node: E/2/c/2,  Previous: E/2/c/1,  Up: E/2/c    
1600
1601    2: Wraparound.
1602
1603 On displays that can erase selectively, wraparound simply
1604 puts the cursor on the top line, clearing it.
1605 On Tektronix-like displays (those which can't erase selectively),
1606 wrapaound clears the screen, since it can't clear only the
1607 top line.  Because this is necessary, **MORE** processing is
1608 less likely to be suppressed on such terminals.
1609 Wraparound does take place on printing ttys, but it is
1610 indistinguishable from ordinary linefeed.
1611 \1f\f
1612 File: ITSTTY,  Node: E/3,  Previous: E/2,  Up: E,  Next: E/4
1613
1614  3. DISPLAY-MODE CHANNELS.  ^P-CODES.
1615
1616 It would be impossible to output a display command using a channel
1617 which simply printed any character sent out on it.  If it is desired
1618 to make use of display commands, a channel may be opened in display
1619 mode.  That causes the character "^P" to be an escape character when
1620 output on that channel.  When a "^P" is output on a display-mode
1621 channel, it has no effect except for setting bits causing the next
1622 character output on that channel to be interpreted as a display code.
1623 The display codes are:
1624
1625 A       Advance to a fresh line.  If at beginning of line do nothing,
1626          else act like a CRLF.
1627 B       move Backward.  Decrements the horizontal position.
1628          If the horizontal position is 0, it is set to the horizontal
1629          screen size minus two, and the vertical position is decreased
1630          by one.  Thus, it moves back over one character position even
1631          if there was a line continuation in the way.
1632 C       Clear screen.  The cursor goes to the upper left corner and
1633          the whole screen is cleared.  On a printing tty (%TOMVU is 0)
1634          a CRLF is output, since "clearing the screen" is undefined.
1635          If "^PC" is output to the echo area, only the echo area is
1636          cleared, and only the echo area cursor is moved.
1637 D       move Down.  The vertical position is incremented.  If it becomes
1638          equal to the vertical screen size, it is set to 0.
1639 E       clear to Eof.  The remainder of the current line, and all lower
1640          lines, are erased.  The cursor doesn't move.
1641 F       move Forward.  The horizontal position is incremented.  At the
1642          end of the line it wraps around to the beginning of the
1643          next line.
1644 H       set Horizontal position.  Takes one argument: the following
1645          character should be the desired horizontal position setting
1646          plus 8.  The vertical position is not changed.  An attempt to
1647          set the position beyond a margin will position it at the
1648          margin.
1649 I       Outputs a one-position printing character in image mode.  Takes one
1650          argument:  the numeric ASCII code of the desired character.
1651 K       Kill (erase) the character the cursor points at.  The cursor
1652          does not move.  The position erased is the one that would be
1653          written in next by ordinary output.
1654 L       clear Line.  The current line, starting with the position that
1655          the cursor points at, is erased.  The cursor does not move.
1656 M       (More) hang up until a character is read in.  *Note More: F/3.
1657 N       (No home-up) similar, but don't home up after the character is
1658          read.
1659 P       output "^P".  Useful if it is desired to output "^P" in image
1660          mode with a display-mode channel, or if the terminal handles
1661          the SAIL character set.
1662 Q       output "^C".  Similar to "^PP".  This is needed only for block
1663          mode IOT's.  With SIOT, it is not needed since "^C" isn't special.
1664 R       Restore cursor position.  The cursor is set to the most
1665          recently saved value.
1666 S       Save cursor position.  Remembers the current cursor position
1667          for use with "^PR".  There is no stack for saved cursor
1668          positions; only the most recent saved position is remembered.
1669 T       go to Top of screen (home up).  The cursor is positioned at the
1670          upper left corner of the screen.
1671 U       move Up.  The vertical position is decremented.  If it was 0,
1672          it becomes equal to the vertical size minus one.
1673 V       set Vertical position.  Takes the following character as an
1674          argument - it should be 8 plus the desired vertical position.
1675          An attempt to set the cursor beyond the top or bottom margin
1676          will position it as far as allowed in the desired direction.
1677          Similarly, "^PV" will not move the echo area cursor outside
1678          the echo area.  Note that vertical positions in the echo area
1679          are to be specified relative to the top of the echo area.
1680 X       backspace and erase one character ("^PB" followed by "^PK").
1681          If done at column zero, it clears the last TWO characters on
1682          the previous line (assuming that one of them was the
1683          character you intended to erase, and the other was an "!"
1684          indicating a continuation).
1685 Z       home down.  The cursor is positioned at the lower left corner.
1686 [       insert line.  The current line and all lines below it are
1687         pushed down one slot.  A blank line appears at the current
1688         position.  The cursor does not move.  Works only on terminals
1689         which have %TOLID set (^P\ also).
1690 \       delete line.  The current line disappears, and all teh lines
1691         below it move up by one position.  The bottom line becomes
1692         blank.  The cursor does not move.
1693 ]       obsolete - same as "^PL".
1694 ^       insert character.  All the characters after the cursor move
1695         right one position.  The last one moves off the right margin
1696         and disappears.  A space appears at the cursor, which does not
1697         move.  Works only on terminals which have %TOCID set.
1698 _       delete character.  The character at the cursor disappears, and
1699         all the rest of the characters on the line move left one
1700         position.  A space appears at the end of the line.  The cursor
1701         does not move.
1702 \1f\f
1703 File: ITSTTY,  Node: E/4,  Previous: E/3,  Up: E,  Next: E/5
1704
1705  4. THE ECHO AREA.
1706
1707 Normally there is only one cursor, used by all output, including
1708 echoing, and visible always on the screen.  However, the program may
1709 create an "echo area", which means that there will be two cursors:
1710 one acting just like the normal one, and used for most program
1711 output; the other, restricted to a few lines at the bottom of the
1712 screen, and used for all echoing (and by program output that
1713 specifically requests it).
1714 The terminal will show whichever cursor was used most recently.
1715
1716 The normal cursor is known as the "main-program cursor"; the other, as
1717 the "echo area cursor".
1718
1719 * Menu:
1720
1721 * How:          E/4/a   How the Echo Area Works.
1722 * Creating:     E/4/b   Creating an Echo Area.
1723 \1f\f
1724 File: ITSTTY,  Node: E/4/a,  Previous: E/4,  Up: E/4,  Next: E/4/b
1725
1726   a. How the Echo Area Works.
1727
1728 One of the per-tty/per-job variables in the system is the size of the
1729 echo area.  This variable is 0 iff there is no echo area; this is the
1730 usual case, and all output (including echo) uses the main program
1731 cursor.  If the variable isn't 0, it must be positive and less than the
1732 screen height; that many lines at the bottom of the screen become the
1733 echo area.  Ordinary output using the main program cursor is not
1734 affected by the existence of the echo area, but output done with the
1735 %TIPP2 bit set (and this includes all system echoing), will use the
1736 echo area cursor.  This cursor is restricted to the echo area; ^P-codes
1737 and wraparound for this cursor act as if the top of the screen were
1738 really located at the top of the echo area (the ^P-codes mention how
1739 they treat the echoing cursor if that is special).  Scrolling never
1740 happens to the echo area cursor.  **MORE** processing can happen,
1741 just as with the main program cursor, and completely independently,
1742 but all system echoing is done with %TIMOR set to prevent that.
1743 \1f\f
1744 File: ITSTTY,  Node: E/4/b,  Previous: E/4/a,  Up: E/4  
1745
1746   b. Creating an Echo Area.
1747
1748 When a job is created it has no echo area on its console.  When a tty
1749 in use as a device is first opened, it has no echo area.  The size of
1750 the echo area may be changed (and, in particular, an echo area may be
1751 created or destroyed) with the SCML symbolic system call, described
1752 in section G.3.c.  Also, one of the first-time-only bits in the mode
1753 of the tty input OPEN allows creation of a 3-line echo area.
1754 \1f\f
1755 File: ITSTTY,  Node: E/5,  Previous: E/4,  Up: E,  Next: E/6
1756
1757  5. READING THE CURSOR POSITION.
1758
1759 The symbolic system call RCPOS returns to the program the values
1760 of the cursor positions of both the main-program area and the
1761 echo area.  Each cursor position is returned as a single word
1762 consisting of the vertical position in the left half and the
1763 horizontal position in the right half.  The first value is the
1764 main program area cursor; the second, the echo area cursor.  The
1765 echo area cursor position is returned relative to the top of the
1766 echo area.  *Note TTY Spec: G/2. for a description of the options
1767 for the first argument and the reasons why the call can fail.
1768 RCPOS does not require ownership of the terminal, just output
1769 permission (*Note Permit: B/3.).  For example:
1770         .CALL [ SETZ
1771                 SIXBIT/RCPOS/
1772                 1000,,CHANNEL
1773                 2000,,MPPOS     ;MP ARE POSITION GOES IN MPPOS.
1774                 402000,,ECHPOS] ;ECHO AREA POSITION GOES IN
1775                                  ;ECHPOS.
1776          .VALUE                 ;CALL FAILED.
1777         ...                     ;CALL SUCCEEDED.
1778 \1f\f
1779 File: ITSTTY,  Node: E/6,  Previous: E/5,  Up: E,  Next: E/7
1780
1781  6. SUPERIMAGE OUTPUT.
1782
1783 When %TISIO is 1, output is done in superimage mode.  That means that
1784 no padding will be done, and the system will not do cursor positioning
1785 or attempt to keep track of where the cursor is; every character
1786 IOT'ed will be sent without change.  In addition, ITS output buffer
1787 display commands may be sent directly, rather than via ^P-codes
1788 (*Note SUPDUP: K/1).  This mode is useful when output is
1789 being done to a strange device that is connected to the system via a
1790 tty line (for example, a logo music box or a PDP11 running the
1791 absolute loader), and when the output has already been put into the
1792 correct form for the particular type of tty (for example, the TELNET
1793 program has a mode that assumes that the foreign host has handled
1794 such things).  It is also useful for programs which do
1795 cursor-position updating, line continuation, etc., themselves,
1796 and want to save time by stopping ITS from doing them.
1797
1798 To be efficient, use SIOT.  Block mode IOT will ignore
1799 "^C", which may be embarrassing.
1800
1801 If the characters output in superimage mode will move the cursor,
1802 the SCPOS system call must be used to tell ITS about it.
1803 *Note SCPOS: K/3.
1804 \1f\f
1805 File: ITSTTY,  Node: E/7,  Previous: E/6,  Up: E,  Next: E/8
1806
1807  7. RELEVANT TTYOPT BITS.
1808
1809 %TOERS says that the tty can erase selectively.  If this bit is not
1810 set, "^PL", and "^PE" cannot be used.  "^PX" and "^PK" will work
1811 anyway, if %TOOVR is off, since then ITS knows it can use a space
1812 to erase a single character.
1813
1814 %TOMVU says that the tty can move its cursor up.  If this bit is not
1815 set, the tty is a printing terminal.  Any attempt to erase will have no
1816 effect.  Horizontal and downward cursor motion will work but not upward
1817 motion.  For the sake of those programs that wish to know about
1818 displays only to the extent of clearing the screen on them every so
1819 often, "^PC" on a printing terminal comes out as a CRLF.
1820
1821 %TOOVR says that the tty can overstrike characters successfully.  The
1822 effect of attempted overstriking on a terminal that can't handle it is
1823 undefined, but on a datapoints what will happen is that only the last
1824 character printed in a given position will be visible.  Note that
1825 outputting a space character will erase iff the terminal cannot
1826 overstrike.  Space should be output only when attempted overstriking is
1827 generally desired - for example, when copying out of a file.  If
1828 erasing is specifically desired, "^PK" should be used (or "^PK^PF" =
1829 move forward, erasing).  If it is specifically desired not to erase,
1830 "^PF" should be used.  For "printing terminals" (or rather, terminals
1831 on which no cursor motion characters except ASCII format effectors
1832 are known) which lack %TOOVR, some cursor motion optimizations are not
1833 done (for example, moving backward can be done only by backspacing,
1834 since CR'ing and spacing forward might erase something useful).
1835
1836 %TOMVB, if 0, means that the terminal can't backspace.  This is true
1837 only of teletypes.  The system will simulate a backspace with a CR and
1838 spaces, but, since that is so slow, backspace should be avoided on such
1839 terminals.  For that reason, it echoes as uparrow-H rather than as a
1840 backspace.
1841
1842 %TOSAI, if 1, says that control characters sent to the terminal will
1843 be one-position graphic characters.  The system will assume that
1844 control characters output in image mode move the cursor one space
1845 right.  Also, altmode will be output as itself, rather than as a
1846 dollarsign, even in ascii or echo mode (but the same is not true of
1847 random control characters, which check %TSSAI).
1848
1849 %TORAW, if 1, says that the various cursor motion characters (space,
1850 tab, CR, LF, and BS) should be output to the terminal in the same
1851 order the program gave them to the system, and in the same way, if
1852 possible.  This bit does not effect the padding done to CR, LF and TAB,
1853 and will not prevent the system from simulating BS and TAB on tty's
1854 that require such simulation.  It will prevent the system from combining
1855 several cursor motion characters to produce their effect more
1856 efficiently; for example, CR's at the beginning of the line will
1857 be ignored when %TORAW is 0, but when it is 1, they will cause CR to
1858 be sent.  Also, CR followed by spaces will always be output in that
1859 manner even if backspacing would be faster.
1860 This bit is normally set by the TELNET server except when the foreign
1861 host is a tip, for the sake
1862 of terminals that don't even always handle CR and LF correctly, but
1863 do manage to handle the sequence CR-LF correctly, etc.
1864 \1f\f
1865 File: ITSTTY,  Node: E/8,  Previous: E/7,  Up: E,  Next: E/9
1866
1867  8. THROWING AWAY TYPEOUT.
1868
1869 Many programs have interrupt characters for requesting that some
1870 output be discarded.  Normally they set flags telling the program not
1871 to output anything.  But on slow terminals the text already in the
1872 output buffer will take an annoyingly long time to come out.  For
1873 that reason, the .RESET UUO and the RESET symbolic system call when
1874 used on slow terminals (those for which %TPORS is 1) throw away the
1875 text in the output buffer.  On fast terminals that is not done.
1876
1877 On all terminals, an output RESET restores the state of several bits
1878 associated with the channel it is given on to normal.  For example,
1879 if the RESET took place after an interrupt out from the middle of
1880 typing out a ^P-code, the RESET will cause the next output character
1881 to be treated normally rather than as a display code.  If the channel
1882 had been hung in a **MORE** (*Note More: F/2/a.) it will be unhung.
1883 \1f\f
1884 File: ITSTTY,  Node: E/9,  Previous: E/8,  Up: E,  Next: E/10
1885
1886  9. WAITING FOR OUTPUT TO BE SENT TO THE TERMINAL.
1887
1888 The symbolic system call FINISH may be used to wait until
1889 the output buffer is empty, meaning that all characters
1890 output by the program have actually been sent to the terminal.
1891 The call's only argument is a tty output channel number:
1892         .CALL [ SETZ
1893                 SIXBIT/FINISH/
1894                 401000,,CHTTYO]
1895          .LOSE %LSFIL           ;CALL FAILS??
1896 FINISH does not require ownership of the terminal;  just output
1897 permission (*Note Permit: B/3.).
1898 \1f\f
1899 File: ITSTTY,  Node: E/10,  Previous: E/9,  Up: E       
1900
1901  10. .STATUS ON TTY OUTPUT CHANNELS.
1902
1903 The information returned as the STATUS of an output channel resembles
1904 that returned for an input channel except that bits 2.1 and 2.2 refer
1905 to the output buffer rather than the input buffer, and bits 2.5, 2.8
1906 and 2.9 are not returned with any information.  *Note In-status: D/7.
1907 \1f\f
1908 File: ITSTTY,  Node: F,  Previous: E,  Up: Top,  Next: G
1909
1910 F. **MORE** PROCESSING.
1911
1912 This feature, when enabled, causes typeout to pause at certain
1913 times (for example, at the bottom of the screen).
1914 Certain events (such as reaching the last line on the screen)
1915 trigger a **MORE** by setting the %TFEOP bit.  Once that has
1916 happened, the next attempt to output a character will cause
1917 the program to be interrupted if it is clever, or cause the
1918 system to wait for the user to order typeout to proceed if the
1919 program is not clever.
1920
1921 * Menu:
1922
1923 * When:         F/1     When **MORE** processing is triggered.
1924 * How:          F/2     How **MORE** processing operates.
1925 * Programmed:   F/3     Programmed invocation of **MORE** processing.
1926 * Inhibition:   F/4     Inhibition of **MORE** processing by input.
1927 \1f\f
1928 File: ITSTTY,  Node: F/1,  Previous: F,  Up: F,  Next: F/2
1929
1930  1. WHEN **MORE** PROCESSING IS TRIGGERED.
1931
1932 The main occasion for triggering is .IOT'ing a LF that reaches
1933 the last line of the screen.  However, triggering has complicated
1934 conditions: it will not happen if %TSMOR is set (%TSMOR's meaning
1935 is "disable **MORE** processing, and this is how it functions);
1936 in scroll mode triggering may not occur until the results of the
1937 previous triggering have scrolled to the top of the screen, or a
1938 home-up ("^PT" or "^PC") has happened.  Note that printing terminals
1939 usually have the screen height set to 200000,, , but wrap around
1940 at line 118., so linefeed will never trigger.  However, if the
1941 screen height of a printing terminal is set to a small value,
1942 **MORE** processing will take place.
1943
1944 The user may trigger a **MORE** whenever he wishes to stop output
1945 temporarily, by typing "^_B".  %TSMOR does not
1946 inhibit this, and scroll mode does not affect it.
1947 \1f\f
1948 File: ITSTTY,  Node: F/2,  Previous: F/1,  Up: F,  Next: F/3
1949
1950  2. HOW **MORE** PROCESSING OPERATES.
1951
1952 Once one of the events described above has triggered it, **MORE**
1953 processing will happen at the next attempt to .IOT a character
1954 out to the terminal, except for output done with %TIMOR set to 1.
1955 The details differ depending on how clever the program wishes to be.
1956
1957 * Menu:
1958
1959 * Stupid:       F/2/a   Stupid Programs.
1960 * Smart:        F/2/b   Smart Programs.
1961 \1f\f
1962 File: ITSTTY,  Node: F/2/a,  Previous: F/2,  Up: F/2,  Next: F/2/b
1963
1964   a. Stupid Programs.
1965
1966 If the tty channel being used for the output IOT that caused
1967 **MORE** processing to occur, is not enabled to interrupt,
1968 ("**MORE**-interrupts are not enabled"), the
1969 system assumes that the program is not clever, and tries to
1970 handle the condition itself, telling the user that there is
1971 more output, and waiting for his command to go ahead and print it.
1972 Before handling the
1973 .IOT'ed character, "**MORE**" is typed out, and the system reads a
1974 character from the ordinary input stream.  Output will resume,
1975 starting with the character whose .IOT'ing was put off to do the
1976 **MORE**, as soon as a character is available to be read.  The input
1977 character will not be thrown away, however, unless it is a space
1978 (that is, if it is not a space, it will remain for the program to
1979 read eventually).  The system will supply a home-up so that output
1980 will resume on the top line of the screen (which, on an Tektronix or
1981 other display without selective erase, requires clearing the screen).
1982
1983 While the system is waiting for an input character, it is actually
1984 hung in the .IOT on the output channel.  The terminal's variables are
1985 not in abnormal state, except for that channel, and .RESET will return
1986 the channel to normal.  Thus, if the character typed in response to the
1987 "**MORE**" is an interrupt character, the interrupt will happen
1988 normally, and if it is dismissed without side-effect, the system will
1989 continue waiting for a character to tell it to proceed.  But if the
1990 interrupt character tells the program to .RESET its output and await a
1991 new command, that will do the right thing.  Also, when a program is
1992 "hung in a **MORE**", if the TTY is taken away by its superior and
1993 then given back, its state will be unchanged, although the superior
1994 will have had no trouble outputting to it (and might even have done
1995 **MORE** processing).
1996 \1f\f
1997 File: ITSTTY,  Node: F/2/b,  Previous: F/2/a,  Up: F/2  
1998
1999   b. Smart Programs.
2000
2001 If the TTY output channel being used for output when  **MORE**
2002 processing becomes necessary is enabled for interrupts, the
2003 system will signal an interrupt on it, and wipe its hands
2004 of the matter.  It is up to the program to pause, or whatever
2005 is desired.  It is a convention that smart programs that
2006 provide the user with the ability to "flush" the rest of
2007 the typeout should type "--MORE--" instead of "**MORE**".
2008 One algorithm for handling **MORE** interrupts might be:
2009 optionally set %TSNOE, type out "--MORE--", do a FLUSH to wait
2010 for the "--MORE--" to come out, then read a character with
2011 %TIPEK and %TIACT set.  At this point, depending on the character,
2012 the routine may gobble it by IOT'ing it again without %TIPEK.
2013 Then, the routine may either flush by typing out a message such
2014 as "flushed", clearing %TSNOE if it was set, re-enabling interrupts
2015 and returning to a restart point, or it may proceed by clearing %TSNOE
2016 and dismissing the interrupt.  The purpose of using %TSNOE here
2017 is to prevent the character typed at the "--MORE--" from echoing
2018 in case it is to cause flushing but not be gobbled - the idea is
2019 that it will echo LATER, when it is re-used as normal input.
2020
2021 Programs which handle **MORE**-interrupts should not .IOT a control
2022 character expecting it to be printed as an uparrow and a printing
2023 character, because that will lose if a **MORE**-interrupt comes
2024 between the two.
2025 \1f\f
2026 File: ITSTTY,  Node: F/3,  Previous: F/2,  Up: F,  Next: F/4
2027
2028  3. PROGRAMMED INVOCATION OF **MORE** PROCESSING.
2029
2030 The two display commands "^PM" and "^PN" cause the channel they are
2031 output on to enter the same state that a channel is in after the
2032 system has typed "**MORE**" through it - namely, waiting for a
2033 character to be read in before outputting any more.  Those commands are
2034 not affected by enabling of **MORE**-interrupts - that is, these
2035 commands issued by even a clever program will enter the state the is
2036 normally entered only for stupid programs.  "^PN" is unusual in that
2037 after the character has been read in, only a linefeed will be done,
2038 instead of a home-up.
2039 \1f\f
2040 File: ITSTTY,  Node: F/4,  Previous: F/3,  Up: F        
2041
2042  4. INHIBITION OF **MORE** PROCESSING BY INPUT.
2043
2044 When the program waits for input, triggering of **MORE** processing
2045 is inhibited for a while.  This is so that a program which is giving
2046 short replies to commands typed in will not do **MORE**'ing, which in
2047 those circumstances would probably be a nuisance.  The details of the
2048 inhibition vary; in scroll mode triggering is inhibited until the
2049 place the cursor was when the program waited for input scrolls to the
2050 top of the screen; otherwise, inhibition takes place the very next
2051 time the bottom is reached, but only if the waiting occurred in the
2052 bottom 5 lines of the screen.  In any case, if a home-up (or
2053 clear-screen) intervenes, there is no inhibition.
2054 It is not the typing of input or the reading of input that inhibits,
2055 but the waiting for input, for the following reasons: if typing ahead
2056 inhibited triggering, it would be impossible to type ahead to a
2057 **MORE**; if reading typed-ahead input inhibited triggering, it would
2058 be possible to lose by typing ahead commands that produced a
2059 surprisingly large amount of input.
2060 \1f\f
2061 File: ITSTTY,  Node: G,  Previous: F,  Up: Top,  Next: H
2062
2063 G. PER-TTY/PER-JOB VARIABLES.
2064
2065 Some of the variables which exist for a tty are intended to
2066 describe the tty to the system or user; others are intended as
2067 program-settable options.  Of those, there are some that are
2068 per-channel, and others that are not, either for historical
2069 reasons, because they are too large to fit in the space that
2070 each channel has for variables, or because they are used by
2071 the input interrupt routine (at input interrupt time it is not
2072 known which channel will be used to read the character).
2073 These variables are maintained per-tty/per-job, which means
2074 that for a tty in use as a device, there is one setting of the
2075 variables, under the control of the job that has the tty open,
2076 but for a tty that is a console, each job in the tree controlled
2077 by the tty may set the variables independently.  The values
2078 actually in effect at any time are those set by the program which
2079 has the tty at that time.  The .ATTY and .DTTY UUO's that transfer
2080 the tty from one job to another in the tree automatically save
2081 the values set by the job that is losing control of the tty, and
2082 restore the per-tty/per-job variables from the last settings made
2083 by the job that is gaining control of the tty.  When a job does
2084 not have the tty, its settings may be examined with the .TTY,
2085 .TTST, .TTS1 and .TTS2 .USET variables.
2086
2087 The variables for a tty which is in use as a device are
2088 initialized when the tty is opened.  Each job's copies of the
2089 variables for its console tty are initialized when the job is
2090 created.  That latter initialization simply copies the job's
2091 superior's settings of the variables, except for the %TSMOR,
2092 %TSROL and %TSSAI bits, which are copied from the appropriate
2093 TTYOPT bits.  The size of the echo area is always initialized to
2094 0 for each new job or tty.  Note that the first input tty open
2095 and the first output tty open will, between them, re-initialize
2096 all of TTYST1 and TTYST2.
2097
2098 There exist symbolic system calls for reading and setting these
2099 variables.  As usual, the calls to read them may be done to any
2100 tty, specified by number, while the calls to set them require a
2101 channel, and thus may be done only to a tty under the control of
2102 the job.  Some of these variables are set by the first-time bits
2103 in the open-mode for tty opens.
2104
2105 * Menu:
2106
2107 * Variables:    G/1     The variables.
2108 * Calls:        G/2     Symbolic system calls.
2109 \1f\f
2110 File: ITSTTY,  Node: G/1,  Previous: G,  Up: G,  Next: G/2
2111
2112  1. THE VARIABLES.
2113
2114 * Menu:
2115
2116 * ST1&2:        G/1/a   The TTYST1 and TTYST2 variables.
2117 * STS:          G/1/b   The TTYSTS variable.
2118 * Size:         G/1/c   The Size of the Echo Area.
2119 \1f\f
2120 File: ITSTTY,  Node: G/1/a,  Previous: G/1,  Up: G/1,  Next: G/1/b
2121
2122    a. the TTYST1 and TTYST2 variables.
2123
2124 These variables contain the information on which characters
2125 should be echoed, and how; on which characters should activate
2126 (cause an .IOT to unhang), and which should interrupt (all this
2127 is used at input interrupt time).  Also, they contain the
2128 information on which characters are to be output in image mode.
2129 A job that does not possess its console has its TTYST1 and TTYST2
2130 settings for the console kept in the .USET variables .TTS1 and .TTS2.
2131
2132 These words are divided into 6-bit bytes, one for each character
2133 group.  All of the options for the characters in any group are
2134 located in the byte for that group, as follows:
2135 %TGINT==1       ;1 => characters in this group should interrupt.
2136                  ;*Note Int: D/4.
2137 %TGACT==2       ;1 => characters in this group should activate.
2138                  ;*Note Act: D/3.
2139 %TGSPC==4       ;1 => perform special hack.  The meaning of this bit
2140                  ;depends on which character-group is in question.
2141                  ;Right now it is defined only for group 1 (letters)
2142                  ;and means "convert lower case to upper case).
2143 %TGIMG==10      ;1 => output the characters of this group in image mode.
2144                  ;*Note Image: E/2. for the consequences of setting this bit.
2145                  ;It is likely that this feature will be flushed soon,
2146                  ;since it cannot be made to work right with the $$^P
2147                  ;feature that allows several jobs to type out at once
2148 %TGPIE==20      ;1 => echo these characters at interrupt level.
2149                  ;*Note Echo: D/1.
2150 %TGMPE==40      ;1 => echo them at main program level
2151                  ;(that is, when they are .IOT'ed in).  *Note Echo: D/1.
2152
2153 The characters are divided into groups based on the ascii code.
2154 TV characters are assigned to groups by converting them to ascii
2155 (thus, the meta bit is ignored, and the control bit is ignored
2156 except with letters, which are converted into ascii control characters).
2157 The groups of characters are:
2158 Group 0:   "^@" - "^F", "^K", "^L", "^N" - "^R", "^T" - "^Z", "^\" - "^^".
2159             (in otherwords, random control characters).
2160 Group 1:   Letters (both upper and lower case).
2161 Group 2:   Digits.
2162 Group 3:   !"#$%&',.:;?@\`|~    (random graphics).
2163 Group 4:   *+-/=^_              (operators)
2164 Group 5:   <>[](){}             (brackets).
2165 Group 6:   "^G" "^S"            (most commonly used interrupt chars).
2166 Group 7:   LF, TAB.
2167 Group 10:  Altmode.
2168 Group 11:  CR.
2169 Group 12:  Rubout.
2170 Group 13:  Space and BS.
2171 \1f\f
2172 File: ITSTTY,  Node: G/1/b,  Previous: G/1/a,  Up: G/1,  Next: G/1/c
2173
2174    b. The TTYSTS variable.
2175
2176 This variable contains many historical relics, as well as information
2177 used to control interrupt level actions, and to signal the user program.
2178 The prefix "%TS" is used for bits in the TTYSTS variable.  When a job
2179 does not possess its console, its TTYSTS setting for the console may
2180 be found in its .TTST variable.
2181
2182 %TSFRE==400000  ;4.9 1 => tty is free (not in use as device or console)
2183 %TSCLE==200000  ;4.8 1 => "^L" output in echo mode should always come
2184                  ;out as uparrow-L.  (Normally, "^L" echoes as a clear
2185                  ;screen on displays).
2186 %TSHDX==100000  ;4.7 same as %TOHDX.  This is vestigial.
2187 %TSFCO==040000  ;4.6 1 => use the full 12-bit TV character set for
2188                  ;output and echoing.  The control bit outputs as "^A"
2189                  ;or "alpha", the meta bit outputs as "^B" or "beta", and
2190                  ;the super bit outputs as "^F" or "epsilon".
2191                  ;Also, the top bit is used to distinguish ASCII control
2192                  ;characters from Sail graphic characters.  The main value
2193                  ;of this feature is for its effect on echoing.
2194 %TSALT==020000  ;4.5 1 => don't standardize altmodes.
2195 %TSROL==010000  ;4.4 1 => scroll mode is in effect.
2196                  ;Complemented by "^_"""".
2197 %TSSAI==004000  ;4.3 1 => echo and ascii output should use SAIL chars.
2198                  ;Complemented by "^_^".
2199 %TSACT==002000  ;4.2 1 => next input IOT shouldn't wait for an
2200                  ;activation character to have been typed in.
2201 %TSNEA==001000  ;4.1 => Don't echo in echo area; echo in M.P. area.
2202 %TSINT==000400  ;3.9 1 => next input character should interrupt even
2203                  ;if its %TGINT bit doesn't say it should.
2204 %TSMOR==000200  ;3.8 1 => inhibit **MORE** processing.
2205                  ;Complemented by "^_M".
2206 %TSATY==000100  ;3.7 this bit is set whenever an .ATTY executed by a
2207                  ;superior gives the tty to the job.  It is what TECO
2208                  ;uses to know that it should clear the screen before
2209                  ;the next display.
2210                 ;3.6-3.5 unused.
2211 %TSNOE==000010  ;3.4 1 => defer echoing (*Note Echo: D/1.).
2212 %TSLCZ==000004  ;3.3 1 => the last character typed in was "^Z".
2213                  ;If this bit is 1, .ATTY fails (*Note ATTY: B/2.).
2214 %TSSII==000002  ;3.2 1 => superimage input.  The special treatment of
2215                  ;"^Z" and "^_" is suppressed.
2216 %TSCNS==000001  ;3.1 1 => the tty is a console (not a device).
2217
2218 RH:             ;the user-index of the job that owns the tty, or -1
2219                  ;if the tty is free.  The actual system variable has
2220                  ;the user-index in its internal form but TTYGET
2221                  ;returns it in external form (=internal form
2222                  ;divided by LUBLK).
2223
2224 \1f\f
2225 File: ITSTTY,  Node: G/1/c,  Previous: G/1/b,  Up: G/1  
2226
2227    c. The Size of the Echo Area.
2228
2229 The vertical size of the echo area is a per-tty/per-job
2230 variable.  *Note Echo area: E/4.
2231 \1f\f
2232 File: ITSTTY,  Node: G/2,  Previous: G/1,  Up: G        
2233
2234  2. SYMBOLIC SYSTEM CALLS.
2235
2236 These system calls all take, as the first argument, a tty-specifier
2237 which tells the system which tty's variables are to be read or written.
2238 The tty specifier should either be a channel number, on which a tty
2239 or pseudoteletype should be open (in the latter case, the variables
2240 of the tty which is the alter ego of the sty will be accessed), or be
2241 400000 plus the number of the desired tty (this option is allowed only
2242 for calls that do not alter the variables.  It enables a program to
2243 read the variables of a tty which is in use by a different job).
2244
2245 An invalid tty specifier will cause the call to fail with an
2246 open-failure code such as "NO SUCH DEVICE" or "BAD CHANNEL NUMBER".
2247
2248 If the job specifies its console, but it doesn't possess the console
2249 at the time, the call will wait until the tty is given back by the
2250 superiors.
2251
2252 * Menu:
2253
2254 * Get:  G/2/a   TTYGET - read TTYST1, TTYST2, TTYSTS.
2255 * Set:  G/2/b   TTYSET - set TTYST1, TTYST2, TTYSTS.
2256 * SCML: G/2/c   SCML - Set Number of Command Lines.
2257 \1f\f
2258 File: ITSTTY,  Node: G/2/a,  Previous: G/2,  Up: G/2,  Next: G/2/b
2259
2260   a. TTYGET - read TTYST1, TTYST2, TTYSTS.
2261
2262 The TTYGET symbolic system call takes one argument, which specifies
2263 the tty whose variables are to be read, and returns up to five
2264 values, which are the TTYST1, TTYST2, TTYSTS, TTYTYP and TCTYP
2265 variables of that tty, as set by the job which has control of that
2266 tty at the time the system call is executed.  The argument should be
2267 as described above.
2268
2269 Actually, the right half of the third value returned is the user
2270 index in its external form, rather than its system-internal form,
2271 which is what the right half of the TTYSTS variable in the system
2272 really holds (The internal form is the external form times LUBLK,
2273 a symbol defined in the timesharing system.  The external form is
2274 more useful to user programs - all interfaces with the system
2275 expect the external form, .USET of .UIND returns it, etc.).
2276
2277 As an example, suppose TTYNUM contains the number of a tty whose
2278 variables are to be read.  The following code will read the TTYST1,
2279 TTYST2 and TTYSTS respectively into ST1, ST2, and STS:
2280         MOVE A,TTYNUM
2281         .CALL [ SETZ
2282                 'TTYGET
2283                 1000,,400000(A) ;Immediate arg = 400000+<tty #>
2284                 2000,,ST1       ;1st value returned in ST1.
2285                 2000,,ST2
2286                 402000,,STS]    ;Sign bit marks end of call.
2287          JRST TRANSL             ;User must have translated TTY to a file.
2288         ...                     ;ST1, ST2, STS now set up.
2289
2290 Note that the TTYGET call can fail quite legitimately, if the
2291 user translates device TTY: to a file of commands for the program.
2292 Therefore, you should not naively put a .VALUE or a .LOSE after
2293 a TTYGET, but instead write code to assume that a command file
2294 is being used and do the "appropriate" thing.
2295 \1f\f
2296 File: ITSTTY,  Node: G/2/b,  Previous: G/2/a,  Up: G/2,  Next: G/2/c
2297
2298   b. TTYSET - set TTYST1, TTYST2, TTYSTS.
2299
2300 The TTYSET symbolic system call takes either three or four
2301 arguments.  The first specifies the tty (TTYSET, like the other
2302 calls that alter tty variables, do not allow a tty to be specified
2303 by number).  The second and third arguments are used to set the
2304 TTYST1 and TTYST2 variables.  The fourth, if present, sets the
2305 TTYSTS variable (if there are only three arguments, the TTYSTS
2306 variables is not changed).  The bits %TSFRE, %TSHDX, %TSLCZ and
2307 %TSCNS, as well as the right half of TTYSTS, cannot be changed.
2308 If the %TSINT (the next character should interrupt whatever it is)
2309 bit is turned on, and there is a character in the input buffer
2310 already following the last one that has been .ITYIC'ed, that
2311 character will be made into an interrupt character if it wasn't
2312 already one.
2313 For example, if the desired values of the variables are contained
2314 in ST1, ST1+1, and STS, the variables may be set as follows
2315 (This isn't the simplest way; it is meant to illustrate the
2316 flexibility of the symbolic system call):
2317         MOVEI A,ST1
2318         .CALL [ SETZ
2319                 'TTYSET
2320                 1000,,TYIC      ;Immediate arg = tty channel.
2321                 (A)             ;Set TTYST1 from ST1
2322                 1(A)            ;Set TTYST2 from ST1+1
2323                 400000,,STS]    ;Set TTYSTS from STS
2324          JRST TRANSL             ;User must have translated TTY to a file.
2325         ...                     ;Variables now set.
2326
2327 Most of the time, when TTYSET is used, only a few of the bits
2328 are intended to be changed.  Rather than giving the TTYSET
2329 constant arguments, which is tantamount to making baseless
2330 assumptions about the meanings of the other bits, you should
2331 read in the current values with a TTYGET, change only the bits
2332 you want to change, and then write out the result.
2333
2334 \1f\f
2335 File: ITSTTY,  Node: G/2/c,  Previous: G/2/b,  Up: G/2  
2336
2337   c. SCML - Set Number of Command Lines.
2338
2339 SCML takes two arguments: a tty channel number, and the desired
2340 size of the echo area.  For example, to have 4 echo lines:
2341         .CALL [ SETZ
2342                 SIXBIT/SCML/    ;Note 'SCML is right-justified, and won't do.
2343                 1000,,TYIC      ;Immediate arg = tty channel
2344                 401000,,4]      ;Immediate arg = <# command lines>.
2345          JRST TRANSL             ;User must have translated TTY to a file.
2346         ...                     ;Echo area now set up.
2347
2348 Before attempting to do a SCML, you should verify that the
2349 terminal being used is a display and not a printing terminal.
2350 You should also check for the possibility that TTY was translated
2351 to a file.
2352 \1f\f
2353 File: ITSTTY,  Node: H,  Previous: G,  Up: Top,  Next: I
2354
2355 H. PERMANENT AND SEMIPERMANENT TTY INFORMATION.
2356
2357 The permanent information on a tty describes the characteristics
2358 of the particular type of terminal in use and the line it is connected
2359 to.  The semipermanent information consists of several user-settable
2360 bits controlling system options; they are all reinitialized whenever
2361 a free tty begins to be used.  Also, when a TV or a tty on a dialup line
2362 is freed, the permanent information is reinitialized.  When an STY is
2363 opened after being free its alter ego is similarly reinitialized.
2364
2365 * Menu:
2366
2367 * Variables:    H/1     The variables.
2368 * Calls:        H/2     System calls.
2369 \1f\f
2370 File: ITSTTY,  Node: H/1,  Previous: H,  Up: H,  Next: H/2
2371
2372  1. THE VARIABLES.
2373
2374 * Menu:
2375
2376 * Size:         H/1/a   The Screen Size.
2377 * TTYOPT:       H/1/b   The TTYOPT variable.
2378 * TCTYP:        H/1/c   The TCTYP variable.
2379 * TTYTYP:       H/1/d   The TTYTYP variable.
2380 * TTYCOM:       H/1/e   The TTYCOM Variable.
2381 * TTYROL:       H/1/f   The TTYROL variable or "Scroll Count".
2382 * TTYSMT:       H/1/g   The TTYSMT variable.  Says what sort of
2383                           CPU the terminal is, and to what extent
2384                           it supports graphics.
2385 \1f\f
2386 File: ITSTTY,  Node: H/1/a,  Previous: H/1,  Up: H/1,  Next: H/1/b
2387
2388   a. The Screen Size.
2389
2390 The horizontal screen size is the number of character positions on a
2391 line, not including the column normally used for "!"'s produced by
2392 line continuation.  The vertical screen size is the number of lines
2393 on the screen.  For printing ttys on which **MORE** processing should
2394 never be done, it is 200000,, .  If the screen height on a printing
2395 tty is set to a small value (less than 118.), **MORE** processing will
2396 be done if enabled (this is for the sake of terminals which are
2397 physically displays, but which are being operated as printing terminals
2398 because ITS does not know how to send display operations to them).
2399
2400 Programs which make their output depend on the screen size will be
2401 totally screwed when the user detaches and reattaches on a different
2402 terminal, unless they are specially hacked to recover.  Such programs
2403 should either enable the %PIATY interrupt, or test %TSATY in the
2404 TTYSTS variable regularly, since if the user switches terminal type
2405 for any reason those conditions will certainly be signaled.  When the
2406 interrupt happens or %TSATY is seen, the program should read the
2407 screen size and TTYOPT once again from the system and take appropriate
2408 actions if they have changed.
2409
2410 In the system, the horizontal size plus 1 is stored in the TCMXH
2411 variable, and the vertical size is stored in the TCMXV variable.
2412 \1f\f
2413 File: ITSTTY,  Node: H/1/b,  Previous: H/1/a,  Up: H/1,  Next: H/1/c
2414
2415   b. The TTYOPT variable.
2416
2417 This variable holds the rest of the information on the particular
2418 tty in use: what capabilities it has, and what special treatment it
2419 needs.  Also it holds several user options: %TOMOR, %TOROL, %TOSA1
2420 and %TOCLC.  Programs that base their actions on the value of the
2421 value of the TTYOPT variable should provide for the possibility that
2422 the user changes his terminal type.  They should either test %TSATY in
2423 the TTYSTS variable frequently, or enable %PIATY interrupts.  When the
2424 chosen condition is detected, the program should the re-examine the
2425 value of TTYOPT.
2426
2427 "%TO" signifies a bit in the left half of TTYOPT.  "%TP" signifies a
2428 bit in the right half; "$TP", a byte pointer to a field.
2429
2430 %TOALT==200000  ;4.8 => Standardize altmodes.
2431 %TOCLC==100000  ;4.7 => Convert lower case to upper on input.
2432 %TOERS==40000   ;4.6 => This tty can erase selectively
2433 %TOHDX==20000   ;4.5 => This tty is half-duplex.
2434 %TOMVB==10000   ;4.4 => This tty can handle backspaces directly.
2435 %TOSAI==4000    ;4.3 => This tty can handle the SAIL character
2436                 ;set, if given control characters in image mode.
2437 %TOSA1==2000    ;4.2 => use the SAIL character set for echo and
2438                 ;ascii mode output (actually just init %TSSAI of
2439                 ;new jobs).
2440 %TOOVR==1000    ;4.1 => This tty can overprint successfully.
2441 %TOMVU==400     ;3.9 => This tty can move its cursor upward
2442                 ;(that is, it is a display).
2443 %TOMOR==200     ;3.8 => do **MORE** processing on this tty
2444                 ;(actually just used to init %TSMOR for new jobs).
2445 %TOROL==100     ;3.7 similarly, used to init %TSROL for new jobs.
2446 %TORAW==40      ;3.6 => don't optimize cursor motion (*Note Out: E/7.).
2447 %TOLWR==20      ;3.5 => this tty has lower case keyboard.
2448                 ;(Doesn't affect system actions - exists to
2449                 ;tell user programs what to do).
2450 %TOFCI==10      ;3.4 => this tty's keyboard has full TV character set.
2451 %TOIML==4       ;3.3 => this tty acts like an imlac
2452 %TOLID==2       ;3.2 => this tty can insert/delete lines.
2453 %TOCID==1       ;3.1 => thus tty can insert/delete characters.
2454 $TPPLF==170300  ;3-bit field saying how to pad LF.
2455                 ;0 - don't. 1 - memowreck, 2741 (2 pad chars.).  2 - more.
2456                 ;If a terminet, tells the baud rate.
2457 $TPPCR==140300  ;3-bit field saying how to pad CR.
2458                 ;7 - unused. 6 - memowreck. 5 - 2741. 4 - execuport.
2459                 ;0 - don't. 1 - normal. 2 - double.
2460                 ;On datapoints, number of padding characters desired
2461                 ;before each string of cursor motion commands.
2462 $TPPTB==110300  ;3 bit field saying how much padding needed after tab.
2463                 ;0 => tabs not allowed; else 1 +<# padding chars needed>
2464                 ;On displays: 0 don't use tabs, 1 use tabs,
2465                 ;2 use VT52-style absolute positioning.
2466 %TPMTA==400     ;1.9 => treat bit 1.8 of input characters as the meta bit.
2467                  ;This is for terminals such as Telerays which have Edit keys.
2468 %TPPRN==200     ;1.8 => interchange ( with [, and ) with ], on input.
2469 %TPTEL==100     ;1.7 => Treat CRLF input as CR for TELNET protocol.
2470 %TPCBS==40      ;1.6 => intelligent terminal protocol in use. 
2471                  ; *Note ITP: J.
2472 %TP11T==20      ;1.5 => PDP-11 TV tty.  Reflects %TY11T.
2473                 ;not settable by user.
2474 %TPORS==10      ;1.4 => output reset on this tty should really do something.
2475 %TPRSC==4       ;1.3 => this terminal implements %TDRSU and %TDRSD.
2476                  ;These are commands usable in superimage output
2477                  ;which perform region scrolling.  *Note RSC: K/1.
2478 \1f\f
2479 File: ITSTTY,  Node: H/1/c,  Previous: H/1/b,  Up: H/1,  Next: H/1/d
2480
2481   c. The TCTYP variable.
2482
2483 It tells the system what type of display codes the terminal actually
2484 needs.  The system takes the display commands that are output by
2485 programs and converts them into whatever will accomplish the desired
2486 result on the particular type of tty in use, according to the setting
2487 of the TCTYP variable.  User programs should try to avoid looking at
2488 this variable;  use TTYOPT instead.
2489
2490 The possible values are:
2491
2492 %TNPRT==0       ;printing terminal.
2493 %TNDP==1        ;good datapoint.
2494 %TNODP==2       ;"bad" datapoint or "loser".
2495 %TNIML==3       ;IMLAC.
2496 %TNTEK==4       ;Tektronix 4000 series.
2497 %TNTV==5        ;PDP-11 TV.
2498 %TNMEM==6       ;Memowreck.
2499 %TNSFW==7       ;"software" terminal that expects internal ITS
2500                 ;display commands ("SUPDUP" codes).
2501                 ; *Note SUPDUP: I/3/e.
2502 %TNTRM==10      ;Terminet.
2503 %TNESC==11      ;Display using ASCII standard display codes.
2504 %TNDTM==12      ;A Datamedia 2500.
2505 %TNRAY==13      ;Teleray 1061
2506 %TNHDS==14      ;Concept-100
2507 %TNH19==15      ;H19
2508 %TNAAA==16      ;Ann Arbor Ambassador
2509 \1f\f
2510 File: ITSTTY,  Node: H/1/d,  Previous: H/1/c,  Up: H/1,  Next: H/1/e
2511
2512   d. The TTYTYP variable.
2513
2514 This variable contains the information on the line the tty is
2515 connected to, as opposed to the tty itself.  Most of the fields in
2516 the TTYTYP table cannot be set with a system call.  The exceptions
2517 are the input and output speed codes, which can be as the
2518 ISPEED and OSPEED variables with TTYVAR.
2519
2520 "%TT" signifies a bit in the left half of TTYTYP; "$TT", a byte
2521 pointer to a field.  "%TY" signifies a bit in the right half.
2522
2523 %TTLCL==400000  ;BIT 4.9 ONE => LOCAL TTY
2524 %TT340==200000  ;BIT 4.8 ONE => CONSOLE NEXT TO 340 OR A 340 SLAVE
2525 %TT3HP==100000  ;BIT 4.7 HIGH PRIORITY ON 340
2526 %TTPAR==004000  ;BIT 4.3 TTY needs to have parity sent.
2527 %TTDDI==002000  ;BIT 4.2 DONT DING ON EXCESS INPUT
2528 %TTIBM==001000  ;BIT 4.1 DATEL LINE
2529 $TTISP==260400  ;3.8-3.5 INPUT SPEED CODE
2530 $TTOSP==220400  ;3.4-3.1 OUTPUT SPEED CODE
2531 %TYDPK==400000  ;BIT 2.9 => this tty is on a datapoint controller line.
2532 %TYSTY==200000  ;BIT 2.8 => this tty is the alter ego of an STY.
2533 %TYNVA==100000  ;BIT 2.7 => this tty is a NOVA tty (They no longer exist)
2534 %TYMTY==040000  ;BIT 2.6 => this tty is on a Morton controller line.
2535 %TYDIL==020000  ;BIT 2.5 => this tty is on a dial-up line.
2536 %TY11T==010000  ;BIT 2.4 => this tty is a PDP-11 TV.
2537 %TYDL== 004000  ;BIT 2.3 => this tty is on a DC76 line.
2538 %TYOTY==002000  ;BIT 2.2 => this tty is a KA-10 console tty.
2539 %TYETY==001000  ;BIT 2.1 => this tty is a DTE-20 tty.
2540 %TYNTY==000400  ;BIT 1.9 => this tty is a TK-10 tty.
2541 %TYMDM==000200  ;BIT 1.8 => this tty is on a dial-up line with modem control.
2542 %TYKST==000100  ;BIT 1.7 => this tty is a KS-10 console tty.
2543 %TYDZT==000040  ;BIT 1.6 => this tty is a DZ-11 tty on a KS-10.
2544 %TYRLM==000020  ;BIT 1.5 => this tty is a connected to the ROLM data switch.
2545
2546 The meanings of the possible 4-bit speed codes are:
2547  0 = unknown            6 = 1800 baud           13 = 40K baud
2548  1 = 600 baud           7 = 2400 baud           14 = 50K baud
2549  2 = 110 baud          10 = 4800 baud           15 = 80K baud
2550  3 = 150 baud          11 = 9600 baud           16 unused
2551  4 = 300 baud          12 = 25K baud            17 unused
2552  5 = 1200 baud
2553 \1f\f
2554 File: ITSTTY,  Node: H/1/e,  Previous: H/1/d,  Up: H/1,  Next: H/1/f
2555
2556   e. The TTYCOM Variable.
2557
2558 This variable contains the com link status of the tty,
2559 some user options associated with com links, and internal
2560 system flags.  The following bits may be set with a CNSSET:
2561 %TCICO, %TCOCO, %TCRFS, %TCQRY.
2562
2563                 ;4.9 => tty in communicate mode
2564 %TCLFT==200000  ;4.8 => Local Feed Through (set if my program receiving his chars)
2565 %TCRFT==100000  ;4.7 => Remote Feed Through (set if his program receiving my chars)
2566                 ;All characters typed on ttys with %TCRFT are given to all ttys
2567                 ;with %TCLFT.  ^_S and ^_E control these bits.
2568 %TCICO==40000   ;4.6 => Input Communicate Override (allows program to read and
2569                 ;type out, even if the tty is in com mode.
2570 %TCOCO==20000   ;4.5 => Output Communicate Override (allows program to type out
2571                 ;even if the tty is in com mode.
2572                 ;4.4-4.3 => message receipt switch
2573                 ;00 => accept
2574 %TCRFS==10000   ;10 => refuse
2575 %TCQRY==4000    ;01 => interrogate
2576 %TCMTR==2000    ;4.2 => tty's motor is off & must be turned
2577                 ;on before any other output is done
2578                 ;(only terminets have their motors shut off by ITS).
2579 %TCECH==1000    ;4.1 => the last output to this tty was PI echoing
2580                 ;(used to prevent output RESET from throwing away echo).
2581 %TCDET==200     ;3.8 console's tree detached by top level interrupt.
2582                 ;Set by NDETAC as signal to SYSCFM (console-free-msg typer)
2583 %TCDNG==100     ;3.7 => type bell on this tty (because input buffer full).
2584 %TCCBK==40      ;3.6 => reading args for a ^_K on this tty.
2585 %TCCBS==20      ;3.5 => reading args for a ^_S on this tty.
2586 %TCFPD==10      ;3.4 => First part of an output code sequence is done.
2587 %TCTPN==4       ;3.3 type ^_N on leaving com mode (unless user explicitly types ^_N)
2588 %TCPAD==2       ;3.2 0 => padding necessary on datapoint.
2589 %TCHNG==1       ;3.1 line seems not to be interrupting for output,
2590                 ;so don't try to wait for output to get out.
2591
2592 The right half is -1 for a tty that is not in a com link.
2593 For ttys in com links, the RH's are the links in a cirular
2594 list of all the ttys in the com loop.  Each RH is the number
2595 of the next tty in the loop.  The order of the ttys in the
2596 circular list has no significance.
2597 \1f\f
2598 File: ITSTTY,  Node: H/1/f,  Previous: H/1/e,  Up: H/1,  Next: H/1/g
2599
2600   f. The TTYROL variable or "Scroll Count".
2601
2602 The TTYROL variable contains the number of lines that the screen
2603 shifts up when, in scroll mode, an attempt is made to type past the
2604 bottom of the screen.  On most terminals, this is 1.  On terminals that
2605 can't scroll, it should be 0.  On printing terminals (and inferior
2606 displays that ITS thinks are printing terminals) it should be 1.
2607 \1f\f
2608 File: ITSTTY,  Node: H/1/g,  Previous: H/1/f,  Up: H/1
2609
2610   g. The TTYSMT or "SMARTS" variable.
2611
2612 The TTYSMT variable is used to describe smart terminals.
2613 It contains information on three things:
2614
2615       What sort of CPU the terminal has (in case you want to load
2616       a program into it), and
2617
2618       To what extent (if at all) the terminal supports the ITS
2619       local-editing and line-saving protocols, and
2620
2621       To what extent (if at all) the terminal supports the ITS
2622       terminal-independent graphics protocol.
2623       *Note Graphics: (SYSDOC;GRPHCS)*.
2624
2625 %TQ signifies a bit or field in the left half of TTYSMT, and %TR
2626 signifies a bit or field in the right half.
2627
2628 %TQMCH==700000  ;4.7-4.9 CPU type.  0 => unknown or uninteresting.
2629                    ;1 => PDP11.  2 => IMLAC PDS4.  3 => IMLAC PDS1.
2630
2631 ;These bits are for local-editing and line-saving (See SUPDUP doc)
2632 %TRLED==100000  ;2.7 Terminal supports the local-editing protocol.
2633 %TRLSV==034000  ;2.3-2.5 nonzero means terminal can save about 4**n lines.
2634
2635 ;These bits record what timezone the terminal is physically in.
2636 %TRTIM==003700  ;2.2-1.7 signed offset from GMT minus 20.  A value of zero
2637                 ; means don't know, don't care, or user program hasn't
2638                 ; implemented it yet.
2639
2640 ;The remainder of TTYSMT pertains to the graphics protocol.
2641 ;If %TQGRF is 0, it should all be 0.
2642 %TQGRF==1       ;3.1 Terminal understands the graphics protocol.
2643                    ;the old name for this was %TQGPH
2644 %TQHGT==76000   ;4.2-4.6 Character height in dots.
2645 %TQWID==1700    ;3.7-4.1 Character width in dots.
2646
2647 ;The remaining bits and fields in TTYSMT indicate which optional
2648 ;features of the graphics protocol are supported.
2649 %TQSET==2       ;3.2 Terminal implements multiple sets.
2650 %TQREC==4       ;3.3 Terminal implements the rectangle commands.
2651 %TQXOR==10      ;3.4 Terminal implements XOR mode.
2652 %TQBNK==20      ;3.5 Terminal implements blinking.
2653 %TQVIR==40      ;3.6 Terminal implements virtual coordinates.
2654
2655 %TRGIN==400000  ;2.9 Terminal provides graphic input.
2656 %TRGHC==200000  ;2.8 Terminal provides has graphic hardcopy.
2657 %TRSCN==040000  ;2.6 Terminal implements scan-line output.
2658 \1f\f
2659 File: ITSTTY,  Node: H/2,  Previous: H/1,  Up: H        
2660
2661  2. SYSTEM CALLS.
2662
2663 * Menu:
2664
2665 * RSSIZE:       H/2/a   RSSIZE.
2666 * CNSGET:       H/2/b   CNSGET.
2667 * CNSSET:       H/2/c   CNSSET.
2668 * TTYVAR:       H/2/d   TTYVAR.
2669 \1f\f
2670 File: ITSTTY,  Node: H/2/a,  Previous: H/2,  Up: H/2,  Next: H/2/b
2671
2672   a. RSSIZE.
2673
2674 The symbolic system call RSSIZE returns the horizontal and
2675 vertical screen size of a tty.  It takes one argument, like
2676 the argument to TTYGET, and returns two values: the vertical
2677 size and the horizontal size.
2678 \1f\f
2679 File: ITSTTY,  Node: H/2/b,  Previous: H/2/a,  Up: H/2,  Next: H/2/c
2680
2681   b. CNSGET.
2682
2683 This symbolic system call takes one argument specifying the tty
2684 (like TTYGET's argument) and returns seven values:
2685 the vertical screen size,
2686 the horizontal screen size,
2687 the TCTYP variable,
2688 the TTYCOM variable,
2689 the TTYOPT variable,
2690 the TTYTYP variable,
2691 the TTYSMT variable.
2692
2693 Note that the CNSGET call can fail quite legitimately, if the
2694 user translates device TTY: to a file of commands for the program.
2695 Therefore, you should not naively put a .VALUE or a .LOSE after
2696 a CNSGET, but instead write code to assume that a command file
2697 is being used and do the "appropriate" thing.
2698 \1f\f
2699 File: ITSTTY,  Node: H/2/c,  Previous: H/2/b,  Up: H/2,  Next: H/2/d
2700
2701   c. CNSSET.
2702
2703 This symbolic system call is used to set the permanent and
2704 semipermanent variables.  It takes six arguments.  The first is
2705 a tty channel; the next five are the new values of
2706 the vertical screen size,
2707 the horizontal screen size,
2708 the TCTYP variable,
2709 the TTYCOM variable,
2710 the TTYOPT variable.
2711 If the second, third or fourth argument is negative, the
2712 corresponding variable will not be altered.  Fewer than six
2713 arguments may be given, in which case variables corresponding
2714 to arguments not given will not be changed.  The system will
2715 make sure that the variables are not given inconsistent values,
2716 and will not allow some bits in TTYCOM to be changed.
2717
2718 You should always make sure that a CNSSET does not change bits
2719 or variables that you do not specifically want to change.  Do
2720 this by 1) specifying -1's for the screen sizes and TCTYP if
2721 you are not changing them, or 2) reading in the old setting s
2722 with a CNSGET, altering specific bits or variables, and then
2723 writing the altered settings out.
2724 \1f\f
2725 File: ITSTTY,  Node: H/2/d,  Previous: H/2/c,  Up: H/2  
2726
2727   d. TTYVAR.
2728
2729 The TTYVAR symbolic system call allows you to read and/or write
2730 any of the permanent or semipermanent variables.  See the entry
2731 for TTYVAR in the ITS .CALLS file for information on the several
2732 ways of using it.
2733
2734 Variables may be specified by sixbit names and read, written, or
2735 modified (increased, decreased, bits set, cleared, or complemented). 
2736 Of course, some fields of some variables may not be changed;  attempts
2737 to change them will be ignored.  The variable names now allowed are
2738 HEIGHT, IDLTIM, ISPEED, OSPEED, SMARTS, TCTYP, TTYCOM, TTYOPT, TTYROL,
2739 TTYSMT, TTYTYP, and WIDTH.  Many of them have been described under
2740 semipermenent variables.  Here are the rest:
2741
2742   ISPEED and OSPEED are the input and output speeds of the terminal.
2743 They refer to the input and output speed codes stored in the TTYTYP
2744 variable.  However, they are not speed codes;  they are the speeds,
2745 in bauds.  Also, you are allowed to set the ISPEED and OSPEED
2746 variables, while you are not allowed to set the whole TTYTYP variable.
2747
2748   IDLTIM (not at all permanent) is the length of time since the last
2749 input character was typed on the tty, in 30'ths of a second. 
2750
2751   Note that the TTYVAR call can fail quite legitimately, if the
2752 user translates device TTY: to a file of commands for the program.
2753 Therefore, you should not naively put a .VALUE or a .LOSE after
2754 a TTYVAR, but instead write code to assume that a command file
2755 is being used and do the "appropriate" thing.
2756 \1f\f
2757 File: ITSTTY,  Node: I,  Previous: H,  Up: Top,  Next: J
2758
2759 I. PSEUDO-TELETYPES (STY'S).
2760
2761 Pseudo-teletypes are a facility that allows programs to do the
2762 things that users do with terminals - type in on them, and observe
2763 what is typed out on them.  A sty is a device which is analogous to
2764 a user's physical terminal.  Outputting to a sty device is like
2765 typing on a physical terminal's keyboard.  Reading from a sty is
2766 analogous to a physical terminal's gobbling down of output.  Thus,
2767 outputting a "^Z" to a sty just opened would load a DDT.  DDT's
2768 initial typeout "xx ITS.nnn. DDT.nnn." etc. would then be available
2769 as input from the sty.
2770
2771 The system contains many tty devices.  A physical terminal that is
2772 online is the end of a pipeline whose other end is one of the tty
2773 devices.  A sty device is also one end of a pipeline whose other end
2774 is one of the tty devices.  Each sty device has a particular tty
2775 device permanently associated with it; the sty's are distinguished
2776 by number, as are tty's, and the number of the tty associated with
2777 a sty equals the sty number plus the value of the symbol NFSTTY.
2778
2779 Since the most common use of stys is for network TELNET servers,
2780 a special feature called "direct connection" exists for tying
2781 a sty to a pair of network channels, so that all input from the
2782 net is fed to the sty and all input from the sty is fed to the net,
2783 without having to run the actual server program.
2784
2785 * Menu:
2786
2787 * Opening:      I/1     Opening STYs.
2788 * Output:       I/2     Output to STYs.
2789 * Input:        I/3     Input from STYs.
2790 * Closing:      I/4     Closing STYs.
2791 * Controlling:  I/5     Controlling the tty associated with a STY.
2792 * Direct:       I/6     Direct connections to network channels:  STYNET.
2793 * STYGET:       I/7     STYGET.
2794 \1f\f
2795 File: ITSTTY,  Node: I/1,  Previous: I,  Up: I,  Next: I/2
2796
2797  1. OPENING STY'S.
2798
2799 There are two ways to open a sty: opening the STY device, and
2800 opening a Snm device, where nm is the number of the desired sty.
2801 Opening STY is a convenient way of obtaining any sty that is free.
2802 If STY is not open, opening it causes the system to find a sty
2803 which is free and whose associated tty is also free, and open it.
2804 Opening STY when STY is already open on another channel will use the
2805 same sty as before.  Thus, a program that wishes to use one sty can
2806 avoid the trouble of finding a free sty and remembering its number
2807 by using device STY throughout.  For more complicated applications,
2808 any sty may be opened by number (Open device S00 to get sty number
2809 0).  However, a sty that is open in another job may not be opened.
2810
2811 When a sty is opened that was not already open, the tty on the
2812 other end of the pipeline is put into a standard state - the one
2813 that would result from doing :TCTYP PRINTING on that tty.  Also, an
2814 input RESET and an output RESET are done, clearing all buffers.
2815
2816 Sty opens recognize two special mode bits.  Bit 3.3 ("image mode")
2817 on an input open is copied into the associated tty's %TOHDX bit,
2818 so if the sty is opened for input in image mode,
2819 characters output to the sty will not be read back in as echo.
2820 Bit 3.4, if 1 in either an input or an output open, causes the
2821 sty to operate in "don't hang" mode in that direction.
2822 *Note NH Out: I/2/a.  *Note NH In: I/3/a.
2823 Bit 3.5, on input, says that %TDORS should
2824 be provided when tty output is reset, even if the tty is
2825 not a software tty (*Note TDORS: K/2.).  This makes
2826 it possible for the sty handling job to tell when tty output
2827 has been thrown away.
2828
2829 These modes are not remembered separately for each channel;
2830 each open sets the modes for all channels in that direction.
2831 \1f\f
2832 File: ITSTTY,  Node: I/2,  Previous: I/1,  Up: I,  Next: I/3
2833
2834  2. OUTPUT TO STY'S.
2835
2836 IOT'ing a character to a sty output channel is like typing the
2837 character into the tty on the other end of the pipeline.  The
2838 characters "^Z" and "^_" are special just as they are on physical
2839 terminals.  Characters sent to a sty may be echoed, just as
2840 characters typed on a physical terminal may be (of course, the tty
2841 may be made half-duplex, in which case there will be no echoing.
2842 When the sty is opened for input, it is there is an option to make
2843 the tty half-duplex).  The characters output need not be ascii -
2844 any character in the 12-bit TV character set may be output to
2845 the tty, which will treat it the way a TV would.
2846
2847 * Menu:
2848
2849 * Empty:        I/2/a   What happens when the buffer is empty.
2850 * Interrupts:   I/2/b   Interrupts.
2851 * Reset:        I/2/c   RESET on sty output channels.
2852 * Status:       I/2/d   STATUS on sty output channels.
2853 \1f\f
2854 File: ITSTTY,  Node: I/2/a,  Previous: I/2,  Up: I/2,  Next: I/2/b
2855
2856   a. What happens when the buffer is empty.
2857
2858 An attempt to output to a sty channel open in normal output
2859 mode when the tty input buffer has no room in it will wait until
2860 there is room.  This is unlike the treatment of physical
2861 terminals, which unfortunately cannot be told to wait.
2862
2863 If the channel is open in "don't hang" mode, then the character
2864 will be thrown away, and "^G" echoed, just as on a physical
2865 terminal.  This mode is good for programs that simulate special
2866 types of terminals for the user.
2867 \1f\f
2868 File: ITSTTY,  Node: I/2/b,  Previous: I/2/a,  Up: I/2,  Next: I/2/c
2869
2870   b. Interrupts.
2871
2872 If a sty output channel is enabled to interrupt, an interrupt will
2873 happen whenever a job attempts to read from the associated tty and
2874 its input buffer (the sty's output buffer!) is empty.
2875 \1f\f
2876 File: ITSTTY,  Node: I/2/c,  Previous: I/2/b,  Up: I/2,  Next: I/2/d
2877
2878   c. RESET on sty output channels.
2879
2880 A .RESET UUO or a RESET symbolic system call done on a sty output
2881 channel is like a RESET on an input channel; of the associated tty;
2882 all characters waiting in the input buffer of the tty are thrown
2883 away.  If they have not echoed already they will not; if they have
2884 not interrupted already they will not.
2885 \1f\f
2886 File: ITSTTY,  Node: I/2/d,  Previous: I/2/c,  Up: I/2  
2887
2888   d. STATUS on sty output channels.
2889
2890 A .STATUS UUO or STATUS symbolic system call done on a sty output
2891 channel will return the device code 25, and will set bit 2.2 or bit
2892 2.1 if the tty's input buffer is empty or almost full, respectively.
2893 \1f\f
2894 File: ITSTTY,  Node: I/3,  Previous: I/2,  Up: I,  Next: I/4
2895
2896  3. INPUT FROM STY'S.
2897
2898 Characters read in by a sty are like characters received by a
2899 physical terminal's printer.  The sty input effectively comes out of
2900 the tty output buffer.  The sty will read the exact same sequence of
2901 characters that a physical terminal would receive with the same
2902 settings of the various tty variables.  This includes padding and
2903 cursor motion characters according to the setting of the tty's
2904 TTYOPT variable, but the initial setting given to the tty when the
2905 sty is first opened causes padding not to be done.
2906
2907 * Menu:
2908
2909 * Empty:        I/3/a   What happens when the buffer is empty.
2910 * Interrupts:   I/3/b   Interrupts.
2911 * Status:       I/3/c   .STATUS on sty input channels.
2912 * Reset:        I/3/d   .RESET on sty input channels.
2913 \1f\f
2914 File: ITSTTY,  Node: I/3/a,  Previous: I/3,  Up: I/3,  Next: I/3/b
2915
2916   a. What happens when the buffer is empty.
2917
2918 There are two modes of input from sty's, distinguished by what
2919 happens when the tty has no characters to output.  The normal mode
2920 waits for output from the tty to be available.  The other mode,
2921 "don't hang" mode, returns immediately when there is no input,
2922 giving an indication of that fact.  "Don't hang" unit mode IOT's
2923 return -1 instead of an input character.
2924 SIOT's return with the pointer and count not completely advanced.
2925 Block mode IOT's have a kludgerous scheme and should be avoided.
2926 "Don't hang" mode is selected by opening an input
2927 channel with the 20 bit in the open-mode set to 1.
2928 \1f\f
2929 File: ITSTTY,  Node: I/3/b,  Previous: I/3/a,  Up: I/3,  Next: I/3/c
2930
2931   b. Interrupts.
2932
2933 A sty input channel may be enabled to interrupt.  It will do so
2934 whenever input (tty output) is available.  In normal mode, it is
2935 expected that the interrupt routine will read one character; if when
2936 the interrupt is dismissed more are available another interrupt will
2937 occur.  In "don't hang" mode, the interrupt routine should continue
2938 reading until it reads a -1, indicating that no more input is
2939 available at the moment.
2940 \1f\f
2941 File: ITSTTY,  Node: I/3/c,  Previous: I/3/b,  Up: I/3,  Next: I/3/d
2942
2943   c. .STATUS on sty input channels.
2944
2945 A .STATUS UUO or STATUS symbolic system call on a sty input channel
2946 returns bit 2.1 as 1 iff the tty's output buffer is full, and 2.2 as
2947 1 iff it is empty.
2948 \1f\f
2949 File: ITSTTY,  Node: I/3/d,  Previous: I/3/c,  Up: I/3  
2950
2951   d. .RESET on sty input channels.
2952
2953 A .RESET UUO or RESET symbolic system call on a sty input channel
2954 is approximately the same as a .RESET on an output channelof the
2955 associated tty - namely, it throws away what is in the tty's output
2956 buffer.  However, RESET on a tty output channel also initializes some
2957 bits associated with that particular channel, while sty input reset
2958 doesn't change the settings of those bits for any of the tty output
2959 channels.  Also, tty output reset may not actually discard the buffer
2960 if the tty's %TPORS bit is 0, or if the buffer contains PI-echoed
2961 characters, but sty input reset will always clear out the buffer
2962 even in those circumstances.  An input RESET is part of the process
2963 of initializing a sty for use, performed when the sty is opened
2964 after being free.
2965 \1f\f
2966 File: ITSTTY,  Node: I/4,  Previous: I/3,  Up: I,  Next: I/5
2967
2968  4. CLOSING STY'S.
2969
2970 When a sty channel is closed, but the sty is still open on some
2971 other channel, nothing special happens - if the channel were
2972 reopened, nothing would have changed.  In particular, nothing is done
2973 to the state of the associated tty or to characters sitting in its
2974 buffers.
2975
2976 When a sty is closed on the only channel it is open on (this
2977 happens when the only channel it is open on is reopened), if the
2978 associated tty is in use as a tree-controlling console, the tree
2979 will be logged out.  If the tty is in use as a device its status will
2980 not be changed.
2981 \1f\f
2982 File: ITSTTY,  Node: I/5,  Previous: I/4,  Up: I,  Next: I/6
2983
2984  5. CONTROLLING THE TTY ASSOCIATED WITH A STY.
2985
2986 Any of the special symbolic system calls for tty's, except for
2987 LISTEN, may be given a sty channel instead of a tty channel as its
2988 first argument, in which case the function will be performed for the
2989 tty associated with the specified sty.  The calls that are most
2990 useful in this mode are TTYGET, CNSGET and CNSSET.  TTYGET returns
2991 the TTYSTS variable, which tells whether the tty is in use (%TSFRE),
2992 by what job (the R.H.), and whether as a console or as a device
2993 (%TSCNS) (*Note TTYSTS: G/1/b. for a description of the TTYSTS variable and the
2994 values of those two bits).  CNSGET returns the information that ITS
2995 uses in deciding exactly how to treat the tty.  CNSSET sets that
2996 information.  Programs that use sty's will often want to do a CNSSET
2997 to the sty as soon as it has been opened.  For example, the 340D
2998 program does a CNSSET to the sty it uses, setting it to be a
2999 datapoint with a peculiar screen size.  This causes ITS to send
3000 datapoint cursor motion codes to the tty.  The 340D program reads
3001 them from the sty and simulates their effect in the display that it
3002 maintains on the 340.  The TTYCOM variable may be examined with a
3003 CNSGET, and the com-mode status of the tty may be altered by
3004 outputting the appropriate ^_ codes to the STY.
3005
3006 Any symbolic system call that requires a job-spec as an argument may
3007 be given a sty channel, which will signify whatever job has the
3008 associated tty in its possession.
3009 \1f\f
3010 File: ITSTTY,  Node: I/6,  Previous: I/5,  Up: I,  Next: I/7
3011
3012  6. DIRECT CONNECTIONS TO NETWORK CHANNELS:  STYNET.
3013
3014 It is possible with this call to connect a sty to a pair
3015 of network channels, one open for input, and one open for output.
3016 When the direct connection is established, anything received by
3017 the net input socket will be fed automatically as output to the
3018 sty, and any type-out that the sty receives from its TTY will be
3019 fed automatically to the net output channel.  The transfer of
3020 data is handled by the system at clock level, eliminating
3021 the need for the program to wake up at each character.
3022
3023 The STYNET call returns immediately, without actually
3024 transferring any data.  Once established, the direct connection will last until
3025 broken explicitly by the user (with another STYNET), or until an escape condition
3026 is detected by the system.  Escape conditions include receipt
3027 of a TELNET control character on the net input channel, and
3028 either net channel's getting into an abnormal state (other
3029 than %NSOPN, %NSINP, or %NSCLI) - in general, things which
3030 the system expects that the user program will want to take
3031 action on.  When the system detects an escape condition it will
3032 break the direct connection and notify the user program with
3033 an interrupt on the net input channel.
3034 While the connection lasts, interrupts on the net channels
3035 due to arriving data are intercepted by the system, so
3036 an interrupt implies that the connection has been broken.
3037
3038 Only one input and one output net channel can be connected to
3039 a sty, and only one sty can be connected to any net channel.
3040 Both sides of a sty are connected and disconnected at once.
3041 A job can connect a sty if it has the sty open in either direction
3042 (but it will generally want to have both directions open).
3043
3044 When a %TDORS comes out of the sty, indicating that the TTY's
3045 output buffer has been cleared, this is indicated to the net
3046 output channel by means of a network interrupt, and the
3047 string of up to 3 characters specified as the fourth argument
3048 to the STYNET call.  If the tty is a software tty and uses the
3049 intelligent terminal protocol, then output RESETs will also block
3050 the TTY at main program level.  The sty-operating program will
3051 not be informed of this, so it is up to the program at the other
3052 end of the network connection to send back a ^\^P to turn output
3053 back on.
3054
3055 If you use STYNET with the official TELNET protocol, you must
3056 turn on the %TPTEL bit in the sty TTY's TTYOPT variable, to
3057 cause the sequence CR-LF received from the net
3058 to be turned into just a CR.
3059
3060 The arguments to a STYNET call are as follows:
3061
3062 arg 1   sty channel (either direction).
3063 arg 2   -1 to disconnect the sty from its network channels
3064         (in which case args 3 and 4 are unnecessary),
3065         or Net input channel (to connect sty output to).
3066 arg 3   Net output channel (to connect sty input to).
3067 arg 4   Characters to send out on net
3068         when an output .RESET is done on the sty's TTY.
3069         Up to 3 8-bit characters, left-justified.
3070 \1f\f
3071 File: ITSTTY,  Node: I/7,  Previous: I/6,  Up: I        
3072
3073  7. STYGET.
3074
3075 Sty handling programs that wish to take an active interest in
3076 managing the lives of the programs attached to the sty's alter ego
3077 may use the STYGET symbolic system call to get information on
3078 what those jobs are doing.  STYGET takes one argument - a tty spec -
3079 and returns the following five values:
3080
3081 1) The RH is 0 if the sty is free; otherwise, it is the job number
3082      the job that owns the sty.  The LH bits %SSHNG and %SSOHG
3083      if set indicate that input and output, respectively, are in
3084      don't hang mode.
3085    This value contains garbage if the tty is not associated with a sty.
3086 2) -1 if the tty is free; otherwise, the job number of the job
3087      that owns the tty.
3088 3) -1 if the tty is not a console; otherwise, the RH contains the
3089      job number of the top level job in the tty's tree and the LH
3090      is nonzero iff the tree is logging out.
3091 4) Gives information on whether a job is hung trying to use the tty:
3092      Bit 1.1 if 1 => the job owning the tty is waiting for input.
3093      Bit 4.9 if 1 => that job is waiting for output buffer room.
3094 5) Indicates the status of the tty's buffers:
3095      Bit 4.9 if 1 => input is available.
3096      Bit 4.8 if 1 => output buffer space is available.
3097 6) Is the tty's TTYSTA word, which contains these bits:
3098      Bit 4.9 (%TACFM) 1 => tty has had a "console-free"
3099         message printed, and has not been in use since.
3100      Bit 4.8 (%TAC.Z) 1 => tty is being ^Z'd, but the
3101         tree has not been created yet.  %TACFM will
3102         be 0.  If %TACFM is 0 and %TAC.Z is also 0,
3103         the tty is in the process of being freed.
3104      Bit 4.7 (%TANJS) 1 => the ^Z attempt in progress
3105         on this tty is being ignored, because all
3106         the job slots in the system are in use.
3107      Bits 4.6-4.3 (%TANEC) Number of following chars to inhibit echo and
3108         ints for.  This is used for the arg chars that follow Top-E, Top-S,
3109         Top-Y, etc. 
3110
3111 \1f\f
3112 File: ITSTTY,  Node: J,  Previous: I,  Up: Top,  Next: K
3113
3114 J. THE INTELLIGENT TERMINAL PROTOCOL.
3115
3116 The %TPCBS bit in the RH of TTYOPT turns on the intelligent terminal
3117 protocol.  This gives the terminal some extra control over things
3118 through the use of escape sequences introduced by 034 (control
3119 backslash).  These escape sequences are handled at a "lower level"
3120 than everything described above, and the characters composing them
3121 are not echoed.  The idea is not that the user should produce the
3122 escape sequences by typing the characters, but that the terminal
3123 should send them of its own accord when necessary, invisibly to
3124 the user.  For example, when the user types a ^\, the terminal
3125 should send ^\^\, which is how to cause the intelligent terminal
3126 protocol to pass the user's ^\ up to higher levels.
3127
3128 * Menu:
3129
3130 * Escape:       J/1     Escape sequences.
3131 * Alloc:        J/2     Allocation.
3132 * Reset:        J/3     Output-reset.
3133 \1f\f
3134 File: ITSTTY,  Node: J/1,  Previous: J,  Up: J,  Next: J/2
3135
3136  1. ESCAPE SEQUENCES.
3137
3138 (The spaces that appear inside the escape sequences are just
3139 for readability;  they should not actually be sent)
3140
3141 The escape sequences are:
3142
3143 ^\ <ch1> <ch2> where <ch1> is in {@, A, B, ..., _} and <ch2> is
3144         any character inputs the character (<ch1>&27)*200+<ch2>.
3145         That is, <ch1> supplies the 4 meta-bits for <ch2>.  The
3146         meta bits are (in their ultimate positions):
3147
3148                 %TXTOP  4000    "TOP"
3149                 %TXSUP  1000    "SUPER"  (Used to mean "SHIFT".)
3150                 %TXMTA   400    "META"
3151                 %TXCTL   200    "CONTROL"
3152
3153         The bits should appear in <ch1> shifted right 5; thus,
3154         "C" = 103 will set %TXCTL and %TXMTA.
3155
3156         Note that %TXCTL and %TXMTA are used with the
3157         uncontrollified character, while %TXTOP is used
3158         with the code for a SAIL-graphic < 40, not with
3159         the letter which appears on that key on a TV keyboard.
3160         Thus, 32 is the code for CALL, while %TXTOP+32 is the
3161         code for the harmless SAIL graphic character NOT-EQUAL
3162         and %TXCTL+132 is the code for CONTROL-Z.
3163         %TXCTL+32 is CONTROL-CALL, and %TXCTL+%TXTOP+32
3164         is CONTROL-NOT-EQUAL.
3165         %TXTOP+132 is meaningless, because %TXTOP makes sense
3166         only with basic 7-bit codes that are less than 40.
3167
3168 (In the following, # represents a number between 0 and 177
3169 (octal) which is simply transmitted as a character.)
3170
3171 ^\ ^A #    increments the allocation by # characters.
3172
3173 ^\ ^Z      zeros the allocation.
3174
3175 ^\ ^I      sets the allocation to infinity.
3176
3177 ^\ ^S      stops output at main program level.
3178
3179 ^\ ^R      restarts output at main program level.
3180
3181 ^\ ^P # #  sets the cursor position.  The first # is the vertical
3182           position (zero at the top of the screen.)  The second #
3183           is the horizontal position (0 at the left margin.)
3184           Output is then restarted at main program level.
3185
3186 ^\ ^\     inputs a ^\.  This is what to send when the user types
3187           ^\ on the keyboard (unless the full character set is
3188           being hacked in which case one would probably use
3189           either "^\ A \" to input a control-backslash, or
3190           "^\ P ^\" to input a less-than-or-equal).
3191
3192 ^\ ^C     signals that the screen has been "messed up".
3193           This gives a %PIATY interrupt to the running program,
3194           just as if its superior had taken the terminal away and
3195           presumably messed up the screen.  Some programs (including
3196           TECO) will respond to this by redisplaying everything.
3197 \1f\f
3198 File: ITSTTY,  Node: J/2,  Previous: J/1,  Up: J,  Next: J/3
3199
3200  2. ALLOCATION.
3201
3202 To provide for intelligent terminals which sometimes can't
3203 process characters as fast as ITS can send them, there is an
3204 output allocation mechanism.  The output allocation is the
3205 number of characters which can be sent to the terminal without
3206 overloading it.  After this number has been sent, ITS will cease
3207 outputting at interrupt level (but IOT'ing of output may
3208 continue if the output buffer is not full).  Transmission will
3209 resume as soon as the terminal increases the allocation above
3210 zero with a ^\ ^A # or a ^\ I.
3211
3212 The initial default value of the allocation is infinity;
3213 thus output normally never stops.  When the terminal wishes to
3214 begin to use the allocation feature, it should do ^\ ^Z to
3215 initialize the allocation to zero.  Then it should do one or more
3216 ^\ ^A #'s to tell ITS how much buffer space it has (more than one
3217 is needed if the terminal wants to say it can buffer more than
3218 177 characters).  When characters arrive from ITS, the terminal
3219 need not do anything, since ITS will decrement the allocation
3220 automatically; but, when the terminal processes the characters
3221 from its buffer, it must tell ITS that the buffer space is free
3222 once more by sending a ^\ ^A #.  For example, the terminal might
3223 send ^\ ^A ^X once for each 24. characters it removes from its
3224 buffer.  If the terminal has reason to suspect that it and ITS
3225 have gotten out of phase in remembering the allocation, it can
3226 always reinitialize without fear using ^\ ^Z ^\ ^A <buffer size>.
3227
3228 To stop using the allocation feature, just do ^\ ^I.
3229 \1f\f
3230 File: ITSTTY,  Node: J/3,  Previous: J/2,  Up: J        
3231
3232  3. OUTPUT-RESET.
3233
3234 If the TTY is a software-tty (*Note Soft: K.), uses the
3235 intelligent terminal protocol (has %TPCBS on in TTYOPT), and
3236 does output-resets (has %TPORS on in TTYOPT), then .RESET on
3237 an output channel to that tty is handled specially.  Any characters
3238 in ITS's output buffer are thrown away, a %TDORS character is
3239 sent to the terminal, and output is blocked at main program
3240 level.  The terminal should then throw away any characters in
3241 its buffer.  If the terminal is connected to ITS through a network
3242 each node in the path should throw away the contents of its
3243 output buffer and pass on the %TDORS.  
3244
3245 When the %TDORS gets to the terminal, it should determine
3246 where the output that wasn't thrown away left the cursor
3247 and send back a ^\ ^P # #, which sets the ITS cursor to this
3248 position and restarts output.
3249 \1f\f
3250 File: ITSTTY,  Node: K,  Previous: J,  Up: Top
3251
3252 K. SOFTWARE TTYS AND ITS OUTPUT BUFFER CODES.
3253
3254 When a tty's TCTYP variable is set to %TNSFW, ITS sends
3255 the contents of the tty output buffer directly to the
3256 terminal, instead of translating it into one of the codes
3257 used by any of the normal types of terminals.  This can
3258 be very convenient for new types of intelligent terminals,
3259 and for sty-handling programs that must actually understand
3260 the data read from the sty.  The data output to a software
3261 tty includes printing characters, and ITS display commands
3262 as are found in the tty output buffer.  Not having to
3263 convert them into a different code at interrupt level saves
3264 time;  in addition, the display commands encode a superset of
3265 the capabilities all real terminals supported by ITS, and
3266 therefore more convenient than the code of any actual terminal.
3267
3268 * Menu:
3269
3270 * Codes:        K/1     ITS output buffer codes.
3271 * TDORS:        K/2     Handling %TDORS.
3272 * SCPOS:        K/3     The SCPOS system call.
3273 \1f\f
3274 File: ITSTTY,  Node: K/1,  Previous: K,  Up: K,  Next: K/2
3275
3276  1. ITS OUTPUT BUFFER CODES.
3277
3278 The internal ITS output buffer codes are 8 bits long.
3279 Sty handlers should read them in unit mode only.  To read
3280 more than one at a time, use SIOT with 8-bit bytes.
3281 Real terminals are assumed to be able to receive only
3282 7-bit characters;  for them, codes 0 - 176 are sent as
3283 is;  codes above 176 have 176 subtracted from them and
3284 are escaped by a 177.  200-codes that have following arguments
3285 which can reasonably be zero (%TDMOV, %TDMV0, %TDMV1)
3286 have 1 added to each argument, so that 0 need not be sent.
3287
3288 Note that not all 200-codes are meaningful on all types
3289 of terminals.  Programs outputting them in superimage mode
3290 must be careful to use codes that work on the terminal
3291 they have.
3292
3293  0 - 177        Characters, to be output as is.
3294                 Normally, only single-spacing graphic characters
3295                 will be sent this way.  Other characters will
3296                 appear if programs output them in image mode.
3297 %TDMOV=200      Move cursor.  followed by 4 bytes of arguments:
3298                 first, the old vertical and horizontal positions
3299                 (these are probably not needed by the sty
3300                 handling program); next, the desired vertical
3301                 and horizontal positions.
3302                 Should not be used on "raw" ttys (%TORAW set),
3303                 though it will work.
3304 %TDMV1==201     Should never be encountered.  If it is, it is
3305                 followed by 2 bytes of args - the desired
3306                 vertical and horizontal positions.
3307                 Should not be used on "raw" ttys (%TORAW set).
3308 %TDEOF==202     Clear rest of line and rest of page.
3309                 Does not move the cursor.
3310                 Does nothing on terminals that aren't selectively
3311                 erasable, even if they are displays.
3312 %TDEOL==203     Clear rest of line
3313 %TDDLF==204     Clear out character after cursor, without moving cursor.
3314 %TDMTF==205     Turn off motor (should not come out except on terminets).
3315 %TDMTN==206     Turn on motor (" ").
3316 %TDCRL==207     Move cursor to beginning of next line,
3317                 and clear that line.  If done when the cursor is on
3318                 the bottom line, it causes the terminal to scroll
3319                 its whole screen up.  The TTYROL variable tells ITS
3320                 how many lines the terminal WILL scroll.
3321 %TDNOP==210     No-op.
3322 %TDBS==211      Backspace - used only on tty's with %TORAW set.
3323 %TDLF==212      Linefeed -               (").
3324 %TDRCR==213     Carriage return -        (").
3325 %TDORS==214     Output reset.  Put in the buffer when a tty
3326                 output reset is done, to inform the sty handling
3327                 program or the terminal.  Should never be sent by
3328                 a program explicitly.
3329 %TDQOT==215     Quote the next character so that it is output to the
3330                 terminal without being interpreted by ITS.
3331 %TDFS==216      Move cursor forward one column.
3332                 This is identical to an appropriate %TDMOV command, and
3333                 exists to increase the efficiency of utilisation of
3334                 space in the output buffer.
3335 %TDMV0==217     Move cursor, followed by 2 args: the desired
3336                 vertical and horizontal positions.
3337                 Should not be used on "raw" ttys (%TORAW set).
3338 %TDCLR==220     Clear the screen, and move the cursor to the top left.
3339                 On printing terminals, it does nothing.
3340 %TDBEL==221     Produce a sound on the terminal, or otherwise try
3341                 to attract the user's attention, without permanently
3342                 altering the contents of the screen.
3343 %TDINI==222     Sent at system start-up to all terminals,
3344                 to tell them to reset themselves.
3345 %TDILP==223     Insert Line Positions.  Followed by a byte containing
3346                 the number of lines to insert.  The current line and
3347                 all lines below it are pushed down on the screen that
3348                 many positions.  Lines pushed off the bottom of the
3349                 screen are lost.  Blank lines appear at the cursor to
3350                 replace the lines shifted downward.  The cursor does
3351                 not move.
3352                 This code and the following one should be used only
3353                 on terminals which have %TOLID set, and only with the
3354                 cursor at the beginning of a line.
3355 %TDDLP==224     Delete Line Positions.  Followed by a byte containing
3356                 the number of positions to delete.  That many lines,
3357                 starting with the current line, disappear.  The lines
3358                 below them are shofted up to take their places.  Blank
3359                 lines are shifted in as necessary at the bottom of the
3360                 screen.  The cursor does not move.
3361 %TDICP==225     Insert Character Positions.  Followed by a byte
3362                 containing the number of spaces to insert.  All of the
3363                 characters on the current line from the cursor to the
3364                 end move that many positions to the right.  The last
3365                 few move off the right margin and disappear.  The
3366                 terminal is not expected to know anything about
3367                 continuation lines.  Spaces are shifted in at the
3368                 cursor to replace the characters that are moving
3369                 right.
3370                 This code and the following one should be used only
3371                 on terminals which have %TOCID set.
3372 %TDDCP==226     Delete Character Positions.  Followed by a byte
3373                 containing the number of character positions to
3374                 delete.  All of the characters to the right of the
3375                 cursor move that many positions left, except for the
3376                 first few, which disappear rather than move past the
3377                 cursor.  Spaces appear at the right margin to replace
3378                 them.
3379 %TDBOW==227     Turns on inverse video mode for characters which are
3380                 output subsequently.  The terminal should use some
3381                 sort of alternate display mode to emphasize them.
3382 %TDRST==230     Turns off inverse video mode.  If any other similar
3383                 modes are created, %TDRST will turn them off too.
3384 %TDGRF==231     This is supposed to be for graphics, but it is not
3385                 implemented by anything.
3386 %TDRSU==232     Region scroll upwards.
3387 %TDRSD==233     Region scroll downwards.  These two commands can be used
3388                 if the %TPRSC bit is on in TTYOPT.  The %TDRSU/%TDRSD
3389                 command is followed by two parameter characters.  The
3390                 first is the number of lines in the region to be scrolled;
3391                 the second is the number of lines by which the text is
3392                 to be scrolled.  A region of the screen, which starts at
3393                 the line containing the cursor and proceeds downward for
3394                 the specified number of lines, is shifted by the specified
3395                 amount.  %TDRSU shifts text upwards, bringing in blank lines
3396                 at the bottom of the region.  %TDRSD shifts text downwards,
3397                 bringing in blank lines at the top of the region.  The
3398                 cursor is not moved.  If either parameter is 0 the command
3399                 should be ignored.  If the size of the region is larger
3400                 than the size of the screen below the cursor, the region
3401                 should end at the bottom of the screen.  If the number of
3402                 lines to scroll by is not less than the size of the region,
3403                 the region should be cleared.
3404 \1f\f
3405 File: ITSTTY,  Node: K/2,  Previous: K/1,  Up: K,  Next: K/3
3406
3407  2. HANDLING %TDORS.
3408
3409 %TDORS is output to a software tty when an output RESET was
3410 done on the tty, discarding some number of output characters.
3411 For a normal terminal, ITS keeps track of the cursor position
3412 at interrupt level;  a RESET knows that the interrupt level
3413 value is the correct one.  For software terminals, ITS does
3414 not remember an interrupt-level cursor position, so it is
3415 up to the terminal (or sty-handler) to inform ITS of the
3416 actual cursor position after each RESET.  RESET turns on
3417 the "hold output" bit for the tty, to make sure that
3418 nothing happens to confuse the matter until that is done.
3419 Actual terminals should use the ^\ ^P # # command of the
3420 Intelligent Terminal Protocol (*Note ITP: J/3.).  Sty
3421 handlers should use the SCPOS system call (*Note SCPOS: K/3.).
3422
3423 %TDORS will be sent to sty ttys even if they are not
3424 software ttys, if %SSORS is set for the sty.  That will
3425 be so if the sty was opened for input with bit 20
3426 set in the open mode.  In this case, SCPOS need not be
3427 done, since the system knows the cursor position.
3428 If the program does something with the %TDORS that
3429 changes the cursor position, however, it should
3430 do an SCPOS to inform ITS of the fact.  Unlike the
3431 case of software ttys and intelligent-terminal
3432 protocol ttys, output will not be hung up until
3433 this SCPOS is received.
3434 \1f\f
3435 File: ITSTTY,  Node: K/3,  Previous: K/2,  Up: K        
3436
3437  3. THE SCPOS SYSTEM CALL.
3438
3439 The SCPOS system call is used for telling ITS that a tty's
3440 cursor is actually located at a given spot.  IT DOES NOT
3441 MOVE THE CURSOR.  To move the cursor, ^P-codes or ITS
3442 output buffer codes must be output.
3443
3444 SCPOS must be used after any event in which ITS does not
3445 understand how the cursor is moving.  Luckily, there are
3446 only two.  A program which has done super-image output
3447 must SCPOS if the output moves the cursor at all;
3448 a sty-handler using a software tty must SCPOS after
3449 an output RESET.  Physical software ttys must do the
3450 equivalent of an SCPOS after output RESETs, but they use
3451 the Intelligent Terminal Protocol instead.
3452
3453 The first argument to an SCPOS system call should be a tty specifier
3454 (*Note TTY spec: G/2.).
3455 The next two arguments should be the corrected vertical and
3456 horizontal positions.
3457 The third argument is optional, and if present sets the TTOALC
3458 variable of the tty.  A third argument of -1 is the way to clear
3459 the hold-output bit after an output reset.
3460
3461 SCPOS does not require ownership of the terminal;  just output
3462 permission (*Note Permit: B/3.).
3463 \1f\f
3464 Tag Table:
3465 File: ITSTTY    Node: Top³8
3466 File: ITSTTY,  Node: Aµ209
3467 File: ITSTTY,  Node: A/1µ783
3468 File: ITSTTY,  Node: A/1/a¶879
3469 File: ITSTTY,  Node: A/2·719
3470 File: ITSTTY,  Node: A/2/a¸631
3471 File: ITSTTY,  Node: A/2/b¹220
3472 File: ITSTTY,  Node: A/2/c¹852
3473 File: ITSTTY,  Node: A/3±1045
3474 File: ITSTTY,  Node: A/4±2512
3475 File: ITSTTY,  Node: A/4/a±3567
3476 File: ITSTTY,  Node: A/4/b±7111
3477 File: ITSTTY,  Node: A/4/c±8543
3478 File: ITSTTY,  Node: A/4/d±9171
3479 File: ITSTTY,  Node: A/4/e±9847
3480 File: ITSTTY,  Node: A/4/f²1071
3481 File: ITSTTY,  Node: A/4/g²2535
3482 File: ITSTTY,  Node: A/5²3286
3483 File: ITSTTY,  Node: B²4887
3484 File: ITSTTY,  Node: B/1²6017
3485 File: ITSTTY,  Node: B/2²6913
3486 File: ITSTTY,  Node: B/3²8783
3487 File: ITSTTY,  Node: B/4²9753
3488 File: ITSTTY,  Node: B/5³1853
3489 File: ITSTTY,  Node: C³2391
3490 File: ITSTTY,  Node: C/1³2882
3491 File: ITSTTY,  Node: C/3³3947
3492 File: ITSTTY,  Node: C/3/a³5386
3493 File: ITSTTY,  Node: C/3/b³5981
3494 File: ITSTTY,  Node: C/3/d³7382
3495 File: ITSTTY,  Node: D³8148
3496 File: ITSTTY,  Node: D/1³9205
3497 File: ITSTTY,  Node: D/2´2157
3498 File: ITSTTY,  Node: D/3´6093
3499 File: ITSTTY,  Node: D/4´7874
3500 File: ITSTTY,  Node: D/5µ2007
3501 File: ITSTTY,  Node: D/6µ2344
3502 File: ITSTTY,  Node: D/7µ3370
3503 File: ITSTTY,  Node: D/8µ4443
3504 File: ITSTTY,  Node: Eµ7111
3505 File: ITSTTY,  Node: E/1µ8393
3506 File: ITSTTY,  Node: E/2¶0094
3507 File: ITSTTY,  Node: E/2/a¶0749
3508 File: ITSTTY,  Node: E/2/a/1¶1944
3509 File: ITSTTY,  Node: E/2/a/2¶2245
3510 File: ITSTTY,  Node: E/2/a/3¶2467
3511 File: ITSTTY,  Node: E/2/a/4¶3456
3512 File: ITSTTY,  Node: E/2/a/5¶4395
3513 File: ITSTTY,  Node: E/2/a/6¶5078
3514 File: ITSTTY,  Node: E/2/a/7¶5516
3515 File: ITSTTY,  Node: E/2/a/8¶6293
3516 File: ITSTTY,  Node: E/2/a/9¶6663
3517 File: ITSTTY,  Node: E/2/a/10¶7087
3518 File: ITSTTY,  Node: E/2/b¶8083
3519 File: ITSTTY,  Node: E/2/c¶9177
3520 File: ITSTTY,  Node: E/2/c/1·0146
3521 File: ITSTTY,  Node: E/2/c/2·0486
3522 File: ITSTTY,  Node: E/3·1015
3523 File: ITSTTY,  Node: E/4·5836
3524 File: ITSTTY,  Node: E/4/a·6612
3525 File: ITSTTY,  Node: E/4/b·7759
3526 File: ITSTTY,  Node: E/5·8265
3527 File: ITSTTY,  Node: E/6·9269
3528 File: ITSTTY,  Node: E/7¸0518
3529 File: ITSTTY,  Node: E/8¸3878
3530 File: ITSTTY,  Node: E/9¸4869
3531 File: ITSTTY,  Node: E/10¸5413
3532 File: ITSTTY,  Node: F¸5791
3533 File: ITSTTY,  Node: F/1¸6575
3534 File: ITSTTY,  Node: F/2¸7551
3535 File: ITSTTY,  Node: F/2/a¸8009
3536 File: ITSTTY,  Node: F/2/b¸9958
3537 File: ITSTTY,  Node: F/3¹1464
3538 File: ITSTTY,  Node: F/4¹2155
3539 File: ITSTTY,  Node: G¹3306
3540 File: ITSTTY,  Node: G/1¹5754
3541 File: ITSTTY,  Node: G/1/a¹5983
3542 File: ITSTTY,  Node: G/1/b¹8395
3543 File: ITSTTY,  Node: G/1/c±00841
3544 File: ITSTTY,  Node: G/2±01029
3545 File: ITSTTY,  Node: G/2/a±02128
3546 File: ITSTTY,  Node: G/2/b±03852
3547 File: ITSTTY,  Node: G/2/c±05628
3548 File: ITSTTY,  Node: H±06320
3549 File: ITSTTY,  Node: H/1±07001
3550 File: ITSTTY,  Node: H/1/a±07472
3551 File: ITSTTY,  Node: H/1/b±08916
3552 File: ITSTTY,  Node: H/1/c±11981
3553 File: ITSTTY,  Node: H/1/d±12930
3554 File: ITSTTY,  Node: H/1/e±14851
3555 File: ITSTTY,  Node: H/1/f±17022
3556 File: ITSTTY,  Node: H/1/g±17487
3557 File: ITSTTY,  Node: H/2±18935
3558 File: ITSTTY,  Node: H/2/a±19126
3559 File: ITSTTY,  Node: H/2/b±19430
3560 File: ITSTTY,  Node: H/2/c±20089
3561 File: ITSTTY,  Node: H/2/d±21194
3562 File: ITSTTY,  Node: I±22741
3563 File: ITSTTY,  Node: I/1±24472
3564 File: ITSTTY,  Node: I/2±26344
3565 File: ITSTTY,  Node: I/2/a±27269
3566 File: ITSTTY,  Node: I/2/b±27858
3567 File: ITSTTY,  Node: I/2/c±28145
3568 File: ITSTTY,  Node: I/2/d±28569
3569 File: ITSTTY,  Node: I/3±28875
3570 File: ITSTTY,  Node: I/3/a±29684
3571 File: ITSTTY,  Node: I/3/b±30410
3572 File: ITSTTY,  Node: I/3/c±30935
3573 File: ITSTTY,  Node: I/3/d±31209
3574 File: ITSTTY,  Node: I/4±32076
3575 File: ITSTTY,  Node: I/5±32726
3576 File: ITSTTY,  Node: I/6±34279
3577 File: ITSTTY,  Node: I/7±37305
3578 File: ITSTTY,  Node: J±39088
3579 File: ITSTTY,  Node: J/1±40013
3580 File: ITSTTY,  Node: J/2±42507
3581 File: ITSTTY,  Node: J/3±44143
3582 File: ITSTTY,  Node: K±45038
3583 File: ITSTTY,  Node: K/1±46035
3584 File: ITSTTY,  Node: K/2±51091
3585 File: ITSTTY,  Node: K/3±52503
3586 \1f End Tag Table:
3587 \f
3588 Don't delete this page.