curses

zben at umd5.UUCP zben at umd5.UUCP
Wed Jun 12 22:07:53 AEST 1985


I posted flames on the same point.  Curses does not support input translation.
Instead, there is a terminal-independant input language for each of the Unix
screen editors.  While this setup may have some merit (once you learn it you
can use any available terminal) I have a Pascal screen editor that I run on
Univac 1100 and IBM 370 systems that I would like to also support Unix.  This
screen editor operates by catching the keystrokes and updating an incore image
of the current screen.  Thus, it MUST know what each keystroke is doing to the
screen...

The amount of brain damage out there in the terminal world is enormous.  There
are dozens of cursor addressing schemes, at least three ways of doing carriage
return/line feed, and several ways of insert/delete character/line schemes.

Without knowing any better, I had coded a separate handler procedure for each
different type of terminal.  Each is only one or two pages, but at this point
my terminal handlers are bigger than the rest of the editor!  I would really
like to move in the direction of terminal capabilities database, but on input
there are some real sticky questions.

For example, when you are in column one, what does a left arrow do?  On many
terminals it does nothing, on many more it goes to column 80 of the previous
line, on some it goes to column 80 of the SAME line.  What does an up arrow
do on line one?  Unix finesses all these questions by refusing to echo the
character in these situations.  On mainframes without smart echo, one does not
have that handy copout.  Thus, in addition to the simple question of what code
does each key generate, these little quirks must all be represented in the
database.

One additional example.  On many terminals, when you do an insert-line 
operation, the cursor is left wherever it was.  But, on the Heathkit, the
cursor is returned to column one!  If you REALLY want to see some brain-
damage, look at the insert mode on the Datamedia 2000/3000 line.

The one example I have seen this done really well on is the Series/1 front
end for IBM 370 machines.  This software talks to your cheap ASCII terminal
and presents a 3270 interface to the mainframe.  Basically replaces one
brain-damaged terminal with another, i.e. attributes eat a screen posn etc.
Putting in a new terminal requires building a bunch of character lookup
tables, however, and reassembling the program, so its not quite as nice as
being database-based.
-- 
Ben Cranston  ...{seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben  zben at umd2.ARPA



More information about the Comp.unix.wizards mailing list