forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtermcap.5
More file actions
1865 lines (1865 loc) · 49.4 KB
/
Copy pathtermcap.5
File metadata and controls
1865 lines (1865 loc) · 49.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\" Copyright (c) 1980 Regents of the University of California.
.\" All rights reserved. The Berkeley software License Agreement
.\" specifies the terms and conditions for redistribution.
.\"
.\" @(#)termcap.5 6.4 (Berkeley) 5/15/86
.\"
.tr ||
.tr *\(**
.TH TERMCAP 5 "1 November 1985"
.UC
.SH NAME
termcap \- terminal capability data base
.SH SYNOPSIS
.B /etc/termcap
.SH DESCRIPTION
.B Termcap\^
is a data base describing terminals,
used,
.IR e.g. ,
by
.BR vi\^ (1)
and
.BR curses\^ (3).
Terminals are described in
.B termcap\^
by giving a set of capabilities that they have and by describing
how operations are performed.
Padding requirements and initialization sequences
are included in
.BR termcap\^ .
.PP
Entries in
.B termcap\^
consist of a number of `:'-separated fields.
The first entry for each terminal gives the names that are known for the
terminal, separated by `|' characters.
The first name is always two characters
long and is used by older systems which store the terminal type
in a 16-bit word in a system-wide data base.
The second name given is the most common abbreviation for the terminal,
the last name given should be a long name fully identifying the terminal,
and all others are understood as synonyms for the terminal name.
All names but the first and last
should be in lower case and contain no blanks;
the last name may well contain
upper case and blanks for readability.
.PP
Terminal names (except for the last, verbose entry)
should be chosen using the following conventions.
The particular piece of hardware making up the terminal
should have a root name chosen, thus \*(lqhp2621\*(rq.
This name should not contain hyphens.
Modes that the hardware can be in
or user preferences
should be indicated by appending a hyphen and an indicator of the mode.
Therefore, a \*(lqvt100\*(rq in 132-column mode would be \*(lqvt100-w\*(rq.
The following suffixes should be used where possible:
.sp
.ta
.if t .ta \w'\fBSuffix\fP\ \ \ 'u +\w'With automatic margins (usually default)\ \ 'u
.if n .ta \w'Suffix\ \ \ 'u +\w'With automatic margins (usually default)\ \ 'u
.nf
.if t .nr Xx \n(.lu-\n(.i-\w'\fBSuffix\fP\ \ \ With automatic margins (usually default)\ \ vt100-am'u
.if t .in +\n(Xxu/2u
\fBSuffix Meaning Example\fP
-w Wide mode (more than 80 columns) vt100-w
-am With automatic margins (usually default) vt100-am
-nam Without automatic margins vt100-nam
-\fIn\fP Number of lines on the screen aaa-60
-na No arrow keys (leave them in local) concept100-na
-\fIn\^\fPp Number of pages of memory concept100-4p
-rv Reverse video concept100-rv
.fi
.SH CAPABILITIES
.PP
The characters in the
.B Notes
field in the table have the following meanings
(more than one may apply to a capability):
.PP
.ta
.ta \w'N\ \ \ 'u
.nr fi \w'N\ \ \ '
.in +\n(fiu
.ti -\n(fiu
N indicates numeric parameter(s)
.ti -\n(fiu
P indicates that padding may be specified
.ti -\n(fiu
* indicates that padding may be based on the number of lines affected
.ti -\n(fiu
o indicates capability is obsolete
.in +\n(fiu
.PP
\*(lqObsolete\*(rq capabilities have no
.B terminfo\^
equivalents,
since they were considered useless,
or are subsumed by other capabilities.
New software should not rely on them at all.
.PP
.if t .ta \w'\fBName \fP'u +\w'\fBType \fP'u +\w'\fBNotes \fP'u
.if n .ta \w'Name 'u +\w'Type 'u +\w'Notes 'u \" Cawf troubled by \w'\fB
.if t .nr fi \w'\fBName Type Notes \fP'
.if n .nr fi \w'Name Type Notes '
.in +\n(fiu
.ti -\n(fiu
\fBName Type Notes Description\fP
.ti -\n(fiu
ae str (P) End alternate character set
.ti -\n(fiu
AL str (NP*) Add \fIn\^\fP new blank lines
.ti -\n(fiu
al str (P*) Add new blank line
.ti -\n(fiu
am bool Terminal has automatic margins
.ti -\n(fiu
as str (P) Start alternate character set
.ti -\n(fiu
bc str (o) Backspace if not \fB^H\fP
.ti -\n(fiu
bl str (P) Audible signal (bell)
.ti -\n(fiu
bs bool (o) Terminal can backspace with \fB^H\fP
.ti -\n(fiu
bt str (P) Back tab
.ti -\n(fiu
bw bool \fBle\fP (backspace) wraps from column 0 to last column
.ti -\n(fiu
CC str Terminal settable command character in prototype
.ti -\n(fiu
cd str (P*) Clear to end of display
.ti -\n(fiu
ce str (P) Clear to end of line
.ti -\n(fiu
ch str (NP) Set cursor column (horizontal position)
.ti -\n(fiu
cl str (P*) Clear screen and home cursor
.ti -\n(fiu
CM str (NP) Memory-relative cursor addressing
.ti -\n(fiu
cm str (NP) Screen-relative cursor motion
.ti -\n(fiu
co num Number of columns in a line (See BUGS section below)
.ti -\n(fiu
cr str (P) Carriage return
.ti -\n(fiu
cs str (NP) Change scrolling region (VT100)
.ti -\n(fiu
ct str (P) Clear all tab stops
.ti -\n(fiu
cv str (NP) Set cursor row (vertical position)
.ti -\n(fiu
da bool Display may be retained above the screen
.ti -\n(fiu
dB num (o) Milliseconds of \fBbs\fP delay needed (default 0)
.ti -\n(fiu
db bool Display may be retained below the screen
.ti -\n(fiu
DC str (NP*) Delete \fIn\^\fP characters
.ti -\n(fiu
dC num (o) Milliseconds of \fBcr\fP delay needed (default 0)
.ti -\n(fiu
dc str (P*) Delete character
.ti -\n(fiu
dF num (o) Milliseconds of \fBff\fP delay needed (default 0)
.ti -\n(fiu
DL str (NP*) Delete \fIn\^\fP lines
.ti -\n(fiu
dl str (P*) Delete line
.ti -\n(fiu
dm str Enter delete mode
.ti -\n(fiu
dN num (o) Milliseconds of \fBnl\fP delay needed (default 0)
.ti -\n(fiu
DO str (NP*) Move cursor down \fIn\^\fP lines
.ti -\n(fiu
do str Down one line
.ti -\n(fiu
ds str Disable status line
.ti -\n(fiu
dT num (o) Milliseconds of horizontal tab delay needed (default 0)
.ti -\n(fiu
dV num (o) Milliseconds of vertical tab delay needed (default 0)
.ti -\n(fiu
ec str (NP) Erase \fIn\^\fP characters
.ti -\n(fiu
ed str End delete mode
.ti -\n(fiu
ei str End insert mode
.ti -\n(fiu
eo bool Can erase overstrikes with a blank
.ti -\n(fiu
EP bool (o) Even parity
.ti -\n(fiu
es bool Escape can be used on the status line
.ti -\n(fiu
ff str (P*) Hardcopy terminal page eject
.ti -\n(fiu
fs str Return from status line
.ti -\n(fiu
gn bool Generic line type (\fIe.g.\fP dialup, switch)
.ti -\n(fiu
hc bool Hardcopy terminal
.ti -\n(fiu
HD bool (o) Half-duplex
.ti -\n(fiu
hd str Half-line down (forward 1/2 linefeed)
.ti -\n(fiu
ho str (P) Home cursor
.ti -\n(fiu
hs bool Has extra \*(lqstatus line\*(rq
.ti -\n(fiu
hu str Half-line up (reverse 1/2 linefeed)
.ti -\n(fiu
hz bool Cannot print ~s (Hazeltine)
.ti -\n(fiu
i1-i3 str Terminal initialization strings (\fBterminfo\^\fP only)
.ti -\n(fiu
IC str (NP*) Insert \fIn\^\fP blank characters
.ti -\n(fiu
ic str (P*) Insert character
.ti -\n(fiu
if str Name of file containing initialization string
.ti -\n(fiu
im str Enter insert mode
.ti -\n(fiu
in bool Insert mode distinguishes nulls
.ti -\n(fiu
iP str Pathname of program for initialization (\fBterminfo\^\fP only)
.ti -\n(fiu
ip str (P*) Insert pad after character inserted
.ti -\n(fiu
is str Terminal initialization string (\fBtermcap\^\fP only)
.ti -\n(fiu
it num Tabs initially every \fIn\^\fP positions
.ti -\n(fiu
K1 str Sent by keypad upper left
.ti -\n(fiu
K2 str Sent by keypad upper right
.ti -\n(fiu
K3 str Sent by keypad center
.ti -\n(fiu
K4 str Sent by keypad lower left
.ti -\n(fiu
K5 str Sent by keypad lower right
.ti -\n(fiu
k0-k9 str Sent by function keys 0-9
.ti -\n(fiu
kA str Sent by insert-line key
.ti -\n(fiu
ka str Sent by clear-all-tabs key
.ti -\n(fiu
kb str Sent by backspace key
.ti -\n(fiu
kC str Sent by clear-screen or erase key
.ti -\n(fiu
kD str Sent by delete-character key
.ti -\n(fiu
kd str Sent by down-arrow key
.ti -\n(fiu
kE str Sent by clear-to-end-of-line key
.ti -\n(fiu
ke str Out of \*(lqkeypad transmit\*(rq mode
.ti -\n(fiu
kF str Sent by scroll-forward/down key
.ti -\n(fiu
kH str Sent by home-down key
.ti -\n(fiu
kh str Sent by home key
.ti -\n(fiu
kI str Sent by insert-character or enter-insert-mode key
.ti -\n(fiu
kL str Sent by delete-line key
.ti -\n(fiu
kl str Sent by left-arrow key
.ti -\n(fiu
kM str Sent by insert key while in insert mode
.ti -\n(fiu
km bool Has a \*(lqmeta\*(rq key (shift, sets parity bit)
.ti -\n(fiu
kN str Sent by next-page key
.ti -\n(fiu
kn num (o) Number of function (\fBk0\fP\-\fBk9\fP) keys (default 0)
.ti -\n(fiu
ko str (o) Termcap entries for other non-function keys
.ti -\n(fiu
kP str Sent by previous-page key
.ti -\n(fiu
kR str Sent by scroll-backward/up key
.ti -\n(fiu
kr str Sent by right-arrow key
.ti -\n(fiu
kS str Sent by clear-to-end-of-screen key
.ti -\n(fiu
ks str Put terminal in \*(lqkeypad transmit\*(rq mode
.ti -\n(fiu
kT str Sent by set-tab key
.ti -\n(fiu
kt str Sent by clear-tab key
.ti -\n(fiu
ku str Sent by up-arrow key
.ti -\n(fiu
l0-l9 str Labels on function keys if not \*(lqf\fIn\^\fP\*(rq
.ti -\n(fiu
LC bool (o) Lower-case only
.ti -\n(fiu
LE str (NP) Move cursor left \fIn\^\fP positions
.ti -\n(fiu
le str (P) Move cursor left one position
.ti -\n(fiu
li num Number of lines on screen or page (See BUGS section below)
.ti -\n(fiu
ll str Last line, first column
.ti -\n(fiu
lm num Lines of memory if > \fBli\fP (0 means varies)
.ti -\n(fiu
ma str (o) Arrow key map (used by \fBvi\^\fP version 2 only)
.ti -\n(fiu
mb str Turn on blinking attribute
.ti -\n(fiu
md str Turn on bold (extra bright) attribute
.ti -\n(fiu
me str Turn off all attributes
.ti -\n(fiu
mh str Turn on half-bright attribute
.ti -\n(fiu
mi bool Safe to move while in insert mode
.ti -\n(fiu
mk str Turn on blank attribute (characters invisible)
.ti -\n(fiu
ml str (o) Memory lock on above cursor
.ti -\n(fiu
mm str Turn on \*(lqmeta mode\*(rq (8th bit)
.ti -\n(fiu
mo str Turn off \*(lqmeta mode\*(rq
.ti -\n(fiu
mp str Turn on protected attribute
.ti -\n(fiu
mr str Turn on reverse-video attibute
.ti -\n(fiu
ms bool Safe to move in standout modes
.ti -\n(fiu
mu str (o) Memory unlock (turn off memory lock)
.ti -\n(fiu
nc bool (o) No correctly-working \fBcr\fP (Datamedia 2500, Hazeltine 2000)
.ti -\n(fiu
nd str Non-destructive space (cursor right)
.ti -\n(fiu
NL bool (o) \fB\\n\fP is newline, not line feed
.ti -\n(fiu
nl str (o) Newline character if not \fB\\n\fP
.ti -\n(fiu
ns bool (o) Terminal is a \s-1CRT\s0 but doesn't scroll
.ti -\n(fiu
nw str (P) Newline (behaves like \fBcr\fP followed by \fBdo\fP)
.ti -\n(fiu
OP bool (o) Odd parity
.ti -\n(fiu
os bool Terminal overstrikes
.ti -\n(fiu
pb num Lowest baud where delays are required
.ti -\n(fiu
pc str Pad character (default \s-2NUL\s0)
.ti -\n(fiu
pf str Turn off the printer
.ti -\n(fiu
pk str Program function key \fIn\^\fP to type string \fIs\fP (\fBterminfo\^\fP only)
.ti -\n(fiu
pl str Program function key \fIn\^\fP to execute string \fIs\fP (\fBterminfo\^\fP only)
.ti -\n(fiu
pO str (N) Turn on the printer for \fIn\^\fP bytes
.ti -\n(fiu
po str Turn on the printer
.ti -\n(fiu
ps str Print contents of the screen
.ti -\n(fiu
pt bool (o) Has hardware tabs (may need to be set with \fBis\fP)
.ti -\n(fiu
px str Program function key \fIn\^\fP to transmit string \fIs\fP (\fBterminfo\^\fP only)
.ti -\n(fiu
r1-r3 str Reset terminal completely to sane modes (\fBterminfo\^\fP only)
.ti -\n(fiu
rc str (P) Restore cursor to position of last \fBsc\fP
.ti -\n(fiu
rf str Name of file containing reset codes
.ti -\n(fiu
RI str (NP) Move cursor right \fIn\^\fP positions
.ti -\n(fiu
rp str (NP*) Repeat character \fIc n\^\fP times
.ti -\n(fiu
rs str Reset terminal completely to sane modes (\fBtermcap\^\fP only)
.ti -\n(fiu
sa str (NP) Define the video attributes
.ti -\n(fiu
sc str (P) Save cursor position
.ti -\n(fiu
se str End standout mode
.ti -\n(fiu
SF str (NP*) Scroll forward \fIn\^\fP lines
.ti -\n(fiu
sf str (P) Scroll text up
.ti -\n(fiu
sg num Number of garbage chars left by \fBso\fP or \fBse\fP (default 0)
.ti -\n(fiu
so str Begin standout mode
.ti -\n(fiu
SR str (NP*) Scroll backward \fIn\^\fP lines
.ti -\n(fiu
sr str (P) Scroll text down
.ti -\n(fiu
st str Set a tab in all rows, current column
.ti -\n(fiu
ta str (P) Tab to next 8-position hardware tab stop
.ti -\n(fiu
tc str Entry of similar terminal \- must be last
.ti -\n(fiu
te str String to end programs that use \fBtermcap\fP
.ti -\n(fiu
ti str String to begin programs that use \fBtermcap\fP
.ti -\n(fiu
ts str (N) Go to status line, column \fIn\^\fP
.ti -\n(fiu
UC bool (o) Upper-case only
.ti -\n(fiu
uc str Underscore one character and move past it
.ti -\n(fiu
ue str End underscore mode
.ti -\n(fiu
ug num Number of garbage chars left by \fBus\fP or \fBue\fP (default 0)
.ti -\n(fiu
ul bool Underline character overstrikes
.ti -\n(fiu
UP str (NP*) Move cursor up \fIn\^\fP lines
.ti -\n(fiu
up str Upline (cursor up)
.ti -\n(fiu
us str Start underscore mode
.ti -\n(fiu
vb str Visible bell (must not move cursor)
.ti -\n(fiu
ve str Make cursor appear normal (undo \fBvs\fP/\fBvi\fP)
.ti -\n(fiu
vi str Make cursor invisible
.ti -\n(fiu
vs str Make cursor very visible
.ti -\n(fiu
vt num Virtual terminal number (not supported on all systems)
.ti -\n(fiu
wi str (N) Set current window
.ti -\n(fiu
ws num Number of columns in status line
.ti -\n(fiu
xb bool Beehive (f1=\s-2ESC\s0, f2=^C)
.ti -\n(fiu
xn bool Newline ignored after 80 cols (Concept)
.ti -\n(fiu
xo bool Terminal uses xoff/xon (\s-2DC3\s0/\s-2DC1\s0) handshaking
.ti -\n(fiu
xr bool (o) Return acts like \fBce cr nl\fP (Delta Data)
.ti -\n(fiu
xs bool Standout not erased by overwriting (Hewlett-Packard)
.ti -\n(fiu
xt bool Tabs ruin, magic \fBso\fP char (Teleray 1061)
.ti -\n(fiu
xx bool (o) Tektronix 4025 insert-line
.in -\n(fiu
.PP
.B A Sample Entry
.PP
The following entry, which describes the Concept\-100, is among the more
complex entries in the
.B termcap\^
file as of this writing.
.PP
.nf
.if t .ta 8n +8n
.if n .ta 2n +2n
ca\||\|concept100\||\|c100\||\|concept\||\|c104\||\|concept100-4p\||\|HDS Concept\-100:\e
:al=3*\eE^R:am:bl=^G:cd=16*\eE^C:ce=16\eE^U:cl=2*^L:cm=\eEa%+ %+ :\e
:co#80:.cr=9^M:db:dc=16\eE^A:dl=3*\eE^B:do=^J:ei=\eE\e200:eo:im=\eE^P:in:\e
:ip=16*:is=\eEU\eEf\eE7\eE5\eE8\eEl\eENH\eEK\eE\e200\eEo&\e200\eEo\e47\eE:k1=\eE5:\e
:k2=\eE6:k3=\eE7:kb=^h:kd=\eE<:ke=\eEx:kh=\eE?:kl=\eE>:kr=\eE=:ks=\eEX:\e
:ku=\eE;:le=^H:li#24:mb=\eEC:me=\eEN\e200:mh=\eEE:mi:mk=\eEH:mp=\eEI:\e
:mr=\eED:nd=\eE=:pb#9600:rp=0.2*\eEr%.%+ :se=\eEd\eEe:sf=^J:so=\eEE\eED:\e
:.ta=8\et:te=\eEv \e200\e200\e200\e200\e200\e200\eEp\er\en:\e
:ti=\eEU\eEv 8p\eEp\er:ue=\eEg:ul:up=\eE;:us=\eEG:\e
:vb=\eEk\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\e200\eEK:\e
:ve=\eEw:vs=\eEW:vt#8:xn:\e
:bs:cr=^M:dC#9:dT#8:nl=^J:ta=^I:pt:
.fi
.PP
Entries may continue onto multiple lines by giving a \e as the last
character of a line, and empty fields
may be included for readability (here between the last field on a line
and the first field on the next).
Comments may be included on lines beginning with \*(lq#\*(rq.
.br
.ne 5
.PP
.B Types of Capabilities
.PP
Capabilities in
.B termcap\^
are of three types: Boolean capabilities,
which indicate particular features that the terminal has;
numeric capabilities,
giving the size of the display or the size of other attributes;
and string capabilities,
which give character sequences that can be used to perform particular
terminal operations.
All capabilities have two-letter codes.
For instance, the fact that
the Concept has
.I automatic margins
.RI ( i.e. ,
an automatic return and linefeed
when the end of a line is reached) is indicated by the Boolean capability
.BR am .
Hence the description of the Concept includes
.BR am .
.PP
Numeric capabilities are followed by the character `#' then the value.
In the example above
.BR co ,
which indicates the number of columns the display has,
gives the value `80' for the Concept.
.PP
Finally, string-valued capabilities, such as
.B ce
(clear-to-end-of-line
sequence) are given by the two-letter code, an `=', then a string
ending at the next following `:'.
A delay in milliseconds may appear after
the `=' in such a capability,
which causes padding characters to be supplied by
.B tputs\^
after the remainder of the string is sent to provide this delay.
The delay can be either a number,
.I e.g.
`20', or a number followed by
an `*',
.IR i.e. ,
`3*'.
An `*' indicates that the padding required is proportional
to the number of lines affected by the operation, and the amount given is
the per-affected-line padding required.
(In the case of insert-character,
the factor is still the number of
.I lines\^
affected;
this is always 1 unless the terminal has
.B in
and the software uses it.)
When an `*' is specified, it is sometimes useful to give a delay of the form
`3.5' to specify a delay per line to tenths of milliseconds.
(Only one decimal place is allowed.)
.PP
A number of escape sequences are provided in the string-valued capabilities
for easy encoding of control characters there.
.B \eE
maps to an \s-2ESC\s0
character,
.B ^X
maps to a control-X for any appropriate X,
and the sequences
.B \en
.B \er
.B \et
.B \eb
.B \ef
map to linefeed, return, tab, backspace, and formfeed, respectively.
Finally, characters may be given as three octal digits after a
.BR \e ,
and the characters
.B ^
and
.B \e
may be given as
.B \e^
and
.BR \e\e .
If it is necessary to place a
.B :
in a capability it must be escaped in
octal as
.BR \e072 .
If it is necessary to place a \s-2NUL\s0
character in a string capability it
must be encoded as
.BR \e200 .
(The routines that deal with
.B termcap\^
use C strings and strip the high bits of the output very late, so that
a
.B \e200
comes out as a
.B \e000
would.)
.PP
Sometimes individual capabilities must be commented out.
To do this, put a period before the capability name.
For example, see the first
.B cr
and
.B ta
in the example above.
.br
.ne 5
.PP
.B Preparing Descriptions
.PP
We now outline how to prepare descriptions of terminals.
The most effective way to prepare a terminal description is by imitating
the description of a similar terminal in
.B termcap\^
and to build up a description gradually, using partial descriptions
with
.B vi\^
to check that they are correct.
Be aware that a very unusual terminal may expose deficiencies in
the ability of the
.B termcap\^
file to describe it
or bugs in
.BR vi\^ .
To easily test a new terminal description you can set the environment variable
.B
.SM TERMCAP
to the absolute pathname of a file containing the description you are working
on and programs will look there rather than in
.BR /etc/termcap\^ .
.B
.SM TERMCAP
can also be set to the
.B termcap\^
entry itself
to avoid reading the file when starting up a program.
.PP
To get the padding for insert-line right
(if the terminal manufacturer did not document it),
a severe test is to use
.B vi\^
to edit
.B /etc/passwd\^
at 9600 baud, delete roughly 16 lines from the middle of the screen,
then hit the `u' key several times quickly.
If the display messes up, more padding is usually needed.
A similar test can be used for insert-character.
.br
.ne 5
.PP
.B Basic Capabilities
.PP
The number of columns on each line of the display is given by the
.B co
numeric capability.
If the display is a \s-1CRT\s0, then the
number of lines on the screen is given by the
.B li
capability.
If the display wraps around to the beginning of the next line when
the cursor reaches the right margin, then it should have the
.B am
capability.
If the terminal can clear its screen,
the code to do this is given by the
.B cl
string capability.
If the terminal overstrikes
(rather than clearing the position when a character is overwritten),
it should have the
.B os
capability.
If the terminal is a printing terminal,
with no soft copy unit,
give it both
.B hc
and
.BR os .
.RB ( os
applies to storage scope terminals,
such as the Tektronix 4010 series,
as well as to hard copy and
.SM APL
terminals.)
If there is a code to move the cursor to the left edge of the current row,
give this as
.BR cr .
(Normally this will be carriage-return,
.BR ^M .)
If there is a code to produce an audible signal (bell, beep,
.IR etc.\^ ),
give this as
.BR bl .
.PP
If there is a code (such as backspace)
to move the cursor one position to the left,
that capability should be given as
.BR le .
Similarly,
codes to move to the right, up, and down
should be given as
.BR nd ,
.BR up ,
and
.BR do ,
respectively.
These
.I local cursor motions\^
should not alter the text they pass over;
for example, you would not normally use
\*(lqnd=\ \*(rq
unless the terminal has the
.B os
capability,
because the space would erase the character moved over.
.PP
A very important point here is that the local cursor motions encoded
in
.B termcap\^
have undefined behavior at the left and top edges of a
.SM CRT
display.
Programs should never attempt to backspace around the left edge,
unless
.B bw
is given, and never attempt to go up off the top
using local cursor motions.
.PP
In order to scroll text up,
a program goes to the bottom left corner of the screen and sends the
.B sf
(index) string.
To scroll text down,
a program goes to the top left corner of the screen and sends the
.B sr
(reverse index) string.
The strings
.B sf
and
.B sr
have undefined behavior
when not on their respective corners of the screen.
Parameterized versions of the scrolling sequences are
.B SF
and
.BR SR ,
which have the same semantics as
.B sf
and
.B sr
except that they take one parameter
and scroll that many lines.
They also have undefined behavior
except at the appropriate corner of the screen.
.PP
The
.B am
capability tells whether the cursor sticks at the right
edge of the screen when text is output there,
but this does not necessarily apply to
.B nd
from the last column.
Leftward local motion is defined from the left edge only when
.B bw
is given; then an
.B le
from the left edge will move to the right edge of the previous row.
This is useful for drawing a box around the edge of the screen,
for example.
If the terminal has switch-selectable automatic margins,
the
.B termcap\^
description usually assumes that this feature is on,
.IR i.e. ,
.BR am .
If the terminal has a command
that moves to the first column of the next line,
that command can be given as
.B nw
(newline).
It is permissible for this to clear the remainder of the current line,
so if the terminal has no correctly-working \s-2CR\s0 and \s-2LF\s0
it may still be possible to craft a working
.B nw
out of one or both of them.
.PP
These capabilities suffice to describe hardcopy and \*(lqglass-tty\*(rq terminals.
Thus the Teletype model 33 is described as
.PP
.nf
T3\||\|tty33\||\|33\||\|tty\||\|Teletype model 33:\e
:bl=^G:co#72:cr=^M:do=^J:hc:os:
.fi
.PP
and the Lear Siegler \s-1ADM\s0\-3 is described as
.PP
.nf
l3\||\|adm3\||\|3\||\|LSI \s-1ADM\s0-3:\e
:am:bl=^G:cl=^Z:co#80:cr=^M:do=^J:le=^H:li#24:sf=^J:
.fi
.br
.ne 5
.PP
.B Parameterized Strings
.PP
Cursor addressing and other strings requiring parameters
are described by a
parameterized string capability, with
.BR printf\^ (3)-like
escapes
.B %x
in it,
while other characters are passed through unchanged.
For example, to address the cursor the
.B cm
capability is given, using two parameters: the row and column to move to.
(Rows and columns are numbered from zero and refer to the physical screen
visible to the user, not to any unseen memory.
If the terminal has memory-relative cursor addressing,
that can be indicated by an analogous
.B CM
capability.)
.PP
The
.B %
encodings have the following meanings:
.PP
.in +16n
.ta +8n
.ti -8n
%% output `%'
.ti -8n
%d output value as in \fBprintf\^\fP %d
.ti -8n
%2 output value as in \fBprintf\^\fP %2d
.ti -8n
%3 output value as in \fBprintf\^\fP %3d
.ti -8n
%. output value as in \fBprintf\^\fP %c
.ti -8n
%+\fIx\fP add \fIx\^\fP to value, then do %.
.ti -8n
%>\fIxy\fP if value > \fIx\^\fP then add \fIy\^\fP, no output
.ti -8n
%r reverse order of two parameters, no output
.ti -8n
%i increment by one, no output
.ti -8n
%n exclusive-or all parameters with 0140 (Datamedia 2500)
.ti -8n
%B BCD (16*(value/10)) + (value%10), no output
.ti -8n
%D Reverse coding (value \- 2*(value%16)), no output (Delta Data)
.ti -16n
.fi
.PP
Consider the Hewlett-Packard 2645, which, to get to row 3 and column 12, needs
to be sent \*(lq\eE&a12c03Y\*(rq padded for 6 milliseconds.
Note that the order
of the row and column coordinates is reversed here
and that the row and column
are sent as two-digit integers.
Thus its
.B cm
capability is \*(lqcm=6\eE&%r%2c%2Y\*(rq.
.PP
The Microterm
.SM ACT-IV
needs the current row and column sent
simply encoded in binary
preceded by a
.BR ^T ,
\*(lqcm=^T%.%.\*(rq.
Terminals that use \*(lq%.\*(rq need to be able to
backspace the cursor
.RB ( le )
and to move the cursor up one line on the screen
.RB ( up ).
This is necessary because it is not always safe to transmit
.BR \en ,
.BR ^D ,
and
.BR \er ,
as the system may change or discard them.
(Programs using
.B termcap\^
must set terminal modes so that tabs are not expanded, so
.B \et
is safe to send.
This turns out to be essential for the Ann Arbor 4080.)
.PP
A final example is the Lear Siegler \s-1ADM\s0\-3a,
which offsets row and column
by a blank character, thus \*(lqcm=\eE=%+ %+ \*(rq.
.PP
Row or column absolute cursor addressing
can be given as single parameter capabilities
.B ch
(horizontal position absolute) and
.B cv
(vertical position absolute).
Sometimes these are shorter than the more general two-parameter sequence
(as with the Hewlett-Packard 2645) and can be used in preference to
.BR cm .
If there are parameterized local motions
.RI ( e.g. ,
move
.I n\^
positions to the right)
these can be given as
.BR DO ,
.BR LE ,
.BR RI ,
and
.B UP
with a single parameter indicating how many positions to move.
These are primarily useful if the terminal does not have
.BR cm ,
such as the Tektronix 4025.
.br
.ne 5
.PP
.B Cursor Motions
.PP
If the terminal has a fast way to home the cursor
(to the very upper left corner of the screen), this can be given as
.BR ho .
Similarly, a fast way of getting to the lower left-hand corner
can be given as
.BR ll ;
this may involve going up with
.B up
from the home position,
but a program should never do this itself (unless
.B ll
does), because it can
make no assumption about the effect of moving up from the home position.
Note that the home position is the same as
cursor address (0,0): to the top left corner of the screen, not of memory.
(Therefore, the \*(lq\eEH\*(rq sequence on Hewlett-Packard terminals
cannot be used for
.BR ho .)
.br
.ne 5
.PP
.B Area Clears
.PP
If the terminal can clear from the current position to the end of the
line, leaving the cursor where it is, this should be given as
.BR ce .
If the terminal can clear from the current position to the end of the
display, this should be given as
.BR cd .
.B cd
must only be invoked from the first column of a line.
(Therefore,
it can be simulated by a request to delete a large number of lines,
if a true
.B cd
is not available.)
.br
.ne 5
.PP
.B Insert/Delete Line
.PP
If the terminal can open a new blank line
before the line containing the cursor,
this should be given as
.BR al ;
this must be invoked only from the first
position of a line.
The cursor must then appear at the left of the newly blank line.
If the terminal can delete the line that the cursor is on, this
should be given as
.BR dl ;
this must only be used from the first position on
the line to be deleted.
Versions of
.B al
and
.B dl
which take a single parameter
and insert or delete that many lines
can be given as
.B AL
and
.BR DL .
If the terminal has a settable scrolling region
(like the VT100),
the command to set this can be described with the
.B cs
capability,
which takes two parameters: the top and bottom lines of the scrolling region.
The cursor position is, alas, undefined after using this command.
It is possible to get the effect of insert or delete line
using this command \(em the
.B sc
and