Using "am" or "xn" in programs considered harmful

Doug Gwyn gwyn at brl-smoke.ARPA
Fri Aug 1 00:34:41 AEST 1986


The DEC VT100 doesn't have the "am" capability no matter how you
set it up, regardless of appearances.  "am" requires that after
a character is displayed in the last column, the cursor move to
the first column of the next row.  The VT100 defers this and in
some cases produces a different display result than if it had a
true "am" capability.

"am" is useful for terminals that have it, but no VT100 termcap
should include "am".  This doesn't preclude enabling auto-wrap
on your VT100, since without "am" no assumption about the right-
margin behavior of the terminal is allowed.  If one's code lets
a character be displayed in the rightmost column, then it has to
consider the cursor position "unknown" unless "am" holds.  This
is no worse than Gilmore's suggestion.  Why handicap terminals
with a true "am" capability?

#
# DEC VT100
# The "vt100" entry supports the Advanced Video Option if present;
# however, AVO is not required for correct operation of the "vt100" entry.
# The following SET-UP modes are assumed for normal operation:
#	ANSI_MODE	AUTO_XON/XOFF_ON	NEWLINE_OFF	80_COLUMNS
# Other SET-UP modes may be set for operator convenience or communication
# requirements; I recommend
#	SMOOTH_SCROLL	AUTOREPEAT_ON	BLOCK_CURSOR	MARGIN_BELL_OFF
#	SHIFTED_3_#	WRAP_AROUND_ON
# Unless you have a graphics add-on such as Digital Engineering's VT640
# (and even then, whenever it can be arranged!) you should set
#	INTERLACE_OFF
# Hardware tabs are assumed to be set every 8 columns; they can be set up
# by the "reset" or "tabs" utility (use vt100-x, 132 columns, for this).
# I have included some compatible code in "rs" for the VT640 if you have one.
# No delays are specified; use "stty ixon -ixany" to enable DC3/DC1 flow control!
d0|vt100|DEC VT100:\
	:ae=^O:as=^N:bl=^G:cd=\E[J:ce=\E[K:cm=\E[%i%d;%dH:co#80:cr=^M:\
	:cs=\E[%i%d;%dr:ct=\E[3g:DO=\E[%dB:do=^J:ho=\E[H:is=\E<\E)0:it#8:\
	:k0=\EOP:k1=\EOQ:k2=\EOR:k3=\EOS:kb=^H:kd=\EOB:ke=\E[?1l\E>:kl=\EOD:\
	:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:l0=PF1:l1=PF2:l2=PF3:l3=PF4:LE=\E[%dD:\
	:le=^H:li#24:ll=\E[24H:mb=\E[5m:md=\E[1m:me=\E[m:mr=\E[7m:ms:nd=\E[C:\
	:nw=\EE:rc=\E8:RI=\E[%dC:\
	:rs=^X\E<\E2\E[?9h^]\E^L^X\E[20l\E[?3;6;9l\E[r\E[m\E[q\E(B^O\E)0\E>:\
	:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:st=\EH:ta=^I:ue=\E[m:UP=\E[%dA:\
	:up=\EM:us=\E[4m:vt#3:xo:\
	:ch=\r\E[%dC:cl=\E[H\E[J:\
	:bs:kn#4:pt:
d8|vt100-w|DEC VT100 with AVO in 132-column mode:\
	:co#132:\
	:rs=^X\E<\E2\E[?9h^]\E^L^X\E[20l\E[?6;9l\E[?3h\
\E[r\E[m\E[q\E(B^O\E)0\E>:\
	:tc=vt100:
d9|vt100-x|DEC VT100 without AVO in 132-column mode:\
	:li#14:ll=\E[14H:\
	:tc=vt100-w:



More information about the Comp.bugs.4bsd.ucb-fixes mailing list