On Wed, Mar 13, 2013 at 02:36:23AM -0400, Mouse wrote:
Okay, now I'm curious. What are the differences?
My mental model of VT100-family autowrap is that sending a character
that would normally go in the rightmost column works but doesn't move
the cursor; another printing character causes a wrap and the new
character is placed in the leftmost column of the new line. This must
be wrong, or at least incomplete, for at least two of the silly
things....
That's correct, but the funny part is what unrelated stuff causes the
"wrap" flag to get cleared. This is off the top of my head so may be
buggy:
write printing character:
if not in final column then
write character to screen
advance cursor
clear "wrap" flag
else
if "wrap" flag set then
<CRLF> (even if ESC [?7l has been received since last printing char)
now write char in column 1 as above
else
write char in final column
(don't advance cursor)
if ESC [?7h mode then
set "wrap" flag
else
clear "wrap" flag
endif
endif
endif
Other things that clear the wrap flag:
VT100: nothing! (practically)
any escape code or ctrl char does its thing w/o affecting wrap flag
Ex.: write a char at col 80, then use ESC [ A / B / C / D and/or
ESC [ y ; x H to move around but wind up at col 80 of any line
and write another char => wraps
VT101: anything that causes the cursor to leave the current line
CR, BS, TAB, ESC [xC, ESC [xD, ESC [ <this line> ; col H etc. don't
LF, ESC [xA, ESC [xB, ESC [ <not this line> ; col H etc. do
Ex.: write a char at col 80, then use ESC [ C / D etc. or BS/TAB to move
around this line but wind up at col 80 and write another char => wraps
VT102: anything that moves the cursor
ESC [m etc. doesn't, so it's not just any data of any kind,
but if the cursor moves then the flag clears
Ex.: write a char at col 80, ESC [D, ESC [C, write another => no wrap
(at least that's what I have so far)
Seems like no big deal, but the VTTEST package (at least the version I've
tried) expects VT102/VT220 behavior and pronounces the actual DEC VT100
(and anything that emulates its wrap behavior) as unworthy, which takes a
certain amount of chutzpah. So I'm having fun obsessing over this lately.
John Wilson
D Bit