[ale] VT-100-220-320 docs, anyone?

John Wells jb at sourceillustrated.com
Thu Dec 7 17:20:14 EST 2006


Jeff Lightner said:
> Oops - il & il1 are in infocmp for vt320 but not vt100.

Ok, well, I fixed my issue. Turned out, the terminal we're using
(http://sf.net/projects/jsat) was setting margins at an improper time when
using vt220 and vt320.

This will hopefully illustrate my point. The terminfo man page, along with
output from infocmp, was indeed very useful. I was able to track down the
two escape sequences that cause our terminal to reset margins: \E8 and
\E[%i%p1%d;%p2%dr.

\E8 maps to "restore_cursor", according to man 5
terminfo...\E[%i%p1%d;%p2%dr  maps to "change_scroll_region". While
"change_scroll_region" sounds reasonable to set margins, as a margin at a
given point in time can refer to both window margins and margins of
scrollable sections, "restore_cursor" raised my eyebrows. Why would you
set margins when responding to "restore_cursor"?

I compared this to a number of other terminals...gnome-terminal, konsole,
and mindterm. I could not find similar behavior in any.

Commenting this out fixed my problem. Here's the actual code, so you can
see what I mean:

case '8': /*restore cursor, attributes, margins */
       C = Sc;
       R = Sr;
       gl = Sgl;
       gr = Sgr;
       for (int i = 0; i < 4; i++) gx[i] = Sgx[i];
       // setMargins(Sbm, Stm);
       attributes = Sa;
       if (debug > 1)
         System.out.println("ESC 8");
     break;

See that commented out setMargins call? That was causing my problem.

Now, my point...if I didn't have gnome-terminal, mindterm and konsole
source (or any terminal source for that matter), how would I know that
resizing the margins would be invalid here? In standard software
development thinking, to create a terminal emulator, you would think you'd
at least have basic requirements, or at least possible actions (escape
sequences) and expected outcomes (what happens in response).

I can get as far as determining that \E8 means "restore_cursor" and
\E[%i%p1%d;%p2%dr  means "change_scroll_region"...but if I didn't have
other terminal source to look at, how would I know what to do when I see
either?

That's the missing link for me.

Thanks guys.

John




More information about the Ale mailing list