1.Go 10 "TERMCAP" 2.PP 3\*E uses fairly standard termcap fields for most things. 4I invented the cursor shape names 5but other than that there should be few surprises. 6.SH 7Required numeric fields 8.if n .ul 0 9.ID 10:co#: number of columns on the screen (chars per line) 11:li#: number of lines on the screen 12.DE 13.SH 14Required string fields 15.ID 16.if n .ul 0 17:ce=: clear to end-of-line 18:cl=: home the cursor & clear the screen 19:cm=: move the cursor to a given row/column 20:up=: move the cursor up one line 21.DE 22.SH 23Boolean fields 24.if n .ul 0 25.ID 26:am: auto margins - wrap when char is written in last column? 27:xn: brain-damaged auto margins - newline ignored after wrap 28:pt: physical tabs? 29.DE 30.SH 31Optional string fields 32.if n .ul 0 33.ID 34:al=: insert a blank row on the screen 35:dl=: delete a row from the screen 36:cd=: clear to end of display 37:ei=: end insert mode 38:ic=: insert a blank character 39:im=: start insert mode 40:dc=: delete a character 41:sr=: scroll reverse (insert row at top of screen) 42:vb=: visible bell 43:ti=: terminal initialization string, to start full-screen mode 44:te=: terminal termination, to end full-screen mode 45:ks=: enables the cursor keypad 46:ke=: disables the cursor keypad 47.DE 48.SH 49Optional strings received from the keyboard 50.if n .ul 0 51.ID 52:kd=: sequence sent by the <down arrow> key 53:kl=: sequence sent by the <left arrow> key 54:kr=: sequence sent by the <right arrow> key 55:ku=: sequence sent by the <up arrow> key 56:kP=: sequence sent by the <PgUp> key 57:kN=: sequence sent by the <PgDn> key 58:kh=: sequence sent by the <Home> key 59:kH=: sequence sent by the <End> key 60:kI=: sequence sent by the <Insert> key 61.DE 62.PP 63Originally, termcap didn't have any names for the <PgUp>, <PgDn>, <Home>, 64and <End> keys. 65Although the capability names shown in the table above are the most common, 66they are \fInot\fR universal. 67SCO Xenix uses :PU=:PD=:HM=:EN=: for those keys. 68Also, if the four arrow keys happen to be part of a 3x3 keypad, 69then the five non-arrow keys may be named :K1=: through :K5=:, 70so an IBM PC keyboard may be described using those names instead. 71\*E can find any of these names. 72.SH 73Optional strings sent by function keys 74.if n .ul 0 75.ID 76:k1=:...:k9=:k0=: codes sent by <F1> through <F10> keys 77:s1=:...:s9=:s0=: codes sent by <Shift F1> ... <Shift F10> 78:c1=:...:c9=:c0=: codes sent by <Ctrl F1> ... <Ctrl F10> 79:a1=:...:a9=:a0=: codes sent by <Alt F1> ... <Alt F10> 80.DE 81.PP 82Note that :k0=: is used to describe the <F10> key. 83Some termcap documents recommend :ka=: or even :k;=: for describing 84the <F10> key, but \*E doesn't support that. 85.PP 86Also, the :s1=:..., :c1=:..., and :a1=:... codes are very non-standard. 87The terminfo library doesn't support them. 88.SH 89Optional fields that describe character attributes 90.if n .ul 0 91.ID 92:so=:se=: start/end standout mode (We don't care about :sg#:) 93:us=:ue=: start/end underlined mode 94:md=:me=: start/end boldface mode 95:as=:ae=: start/end alternate character set (italics) 96:ug#: visible gap left by :us=:ue=:md=:me=:as=:ae=: 97.DE 98.SH 99Optional fields that affect the cursor's shape 100.PP 101The :cQ=: string is used by \*E immediately before exiting to undo 102the effects of the other cursor shape strings. 103If :cQ=: is not given, then all other cursor shape strings are ignored. 104.ID 105:cQ=: normal cursor 106:cX=: cursor used for reading EX command 107:cV=: cursor used for reading VI commands 108:cI=: cursor used during VI input mode 109:cR=: cursor used during VI replace mode 110.DE 111.PP 112If the capabilities above aren't given, then \*E will try to use the 113following values instead. 114.ID 115:ve=: normal cursor, used as :cQ=:cX=:cI=:cR=: 116:vs=: gaudy cursor, used as :cV=: 117.DE 118.SH 119An example 120.PP 121Here's the termcap entry I use on my Minix-ST system. 122Some of the fields in it have nothing to do with \*E. 123Some can only work on my system; 124I have modified my kernel's screen driver. 125.sp 126.LD 127.ne 14 128mx|minix|minixst|ansi:\\ 129 :is=\\E[0~:co#80:li#25:bs:pt:\\ 130 :cm=\\E[%i%d;%dH:up=\\E[A:do=^J:nd=\\E[C:sr=\\EM:\\ 131 :cd=\\E[J:ce=\\E[K:cl=\\E[H\\E[J:\\ 132 :al=\\E[L:dl=\\E[M:ic=\\E[@:dc=\\E[P:im=:ei=:\\ 133 :so=\\E[7m:se=\\E[m:us=\\E[4m:ue=\\E[m:\\ 134 :md=\\E[1m:me=\\E[m:as=\\E[1;3m:ae=\\E[m:\\ 135 :ku=\\E[A:kd=\\E[B:kr=\\E[C:kl=\\E[D:\\ 136 :k1=\\E[1~:k2=\\E[2~:k3=\\E[3~:k4=\\E[4~:k5=\\E[5~:\\ 137 :k6=\\E[6~:k7=\\E[17~:k8=\\E[18~:k9=\\E[19~:k0=\\E[20~:\\ 138 :kU=\\E[36~:kQ=\\E[32~:kH=\\E[28~:\\ 139 :GV=3:GH=D:G1=?:G2=Z:G3=@:G4=Y:GC=E:GL=4:GR=C:GU=A:GD=B:\\ 140 :cQ=\\E[k:cX=\\E[2;0k:cV=\\E[16;0k:cI=\\E[k:cR=\\E[16;20k: 141.DE 142