Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* ISO VT320 emulator with key-bindings for Oracle Forms
@ 1999-06-01  4:00 Frampton Steve R
  1999-06-02  4:00 ` Frank da Cruz
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Frampton Steve R @ 1999-06-01  4:00 UTC (permalink / raw)


Hello:

I'm in need of a VT320 emulator with key-bindings for Oracle
SQL*Forms; it needs to either run under Linux/Unix or else be
an old DOS-based application that I can try running under
"dosemu" (a Windows-based app through Wine would not be
suitable, however).

I'm either looking for an Open Source solution (read: free), or
else something from Digital that my place of employment can get
through the Campus-Wide Software License.

Someone suggested "kermit", but unfortunately I don't know the
key-bindings for the various forms application keys (ie. Menu,
Commit, Find, etc.).  I've tried other supposed VT320 emulators
native to *nix as well -- but found them compliant in the very
loosest sense of the world!

Years ago I used something which I believe was called "setterm"
or "sethost" (the name escapes)... a DOS-based application from
Digital which I believe would fit the bill quite nicely through
dosemu -- but I can't find that software, and my organization
has *long* since discarded all that old DOS-based software media.

I've searched for a suitable solution several times in the past
but I'm still unable to use Forms-based applications from within
a *nix telnet session.  ;-(

*Surely* somebody out there is using a *nix-based system to
communicate with a Vax-based Oracle application server who would
be able to hand me a clue?

Any advice would be greatly appreciated.  Thanks in advance.

--------------< LINUX: The choice of a GNU generation. >--------------
Steve Frampton  <3srf@qlink.queensu.ca>  http://qlink.queensu.ca/~3srf



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-01  4:00 ISO VT320 emulator with key-bindings for Oracle Forms Frampton Steve R
@ 1999-06-02  4:00 ` Frank da Cruz
  1999-06-02  4:00 ` Walter Harms
  1999-06-02  4:00 ` Richard S. Shuford
  2 siblings, 0 replies; 18+ messages in thread
From: Frank da Cruz @ 1999-06-02  4:00 UTC (permalink / raw)


In article <7j1rqo$kul$1@knot.queensu.ca>,
Frampton Steve R  <3srf@qlink.queensu.ca> wrote:
: I'm in need of a VT320 emulator with key-bindings for Oracle
: SQL*Forms; it needs to either run under Linux/Unix or else be
: an old DOS-based application that I can try running under
: "dosemu" (a Windows-based app through Wine would not be
: suitable, however).
: 
: I'm either looking for an Open Source solution (read: free), or
: else something from Digital that my place of employment can get
: through the Campus-Wide Software License.
: 
: Someone suggested "kermit", but unfortunately I don't know the
: key-bindings for the various forms application keys (ie. Menu,
: Commit, Find, etc.).
: 
MS-DOS Kermit includes a VT320 emulator.  A regular VT320 key map
is distributed with version 3.14:

  http://www.columbia.edu/kermit/mskermit.html

If MS-DOS Kermit works for you under Linux, then you can map the
keys however you want.  As you probably know, a VT320 terminal does
not have keys labeled Menu or Commit, so you'll need to find out
what Oracle expects each key to send.   This will be true for any
emulator you look at.

: Years ago I used something which I believe was called "setterm"
: or "sethost" (the name escapes)... a DOS-based application from
: Digital which I believe would fit the bill quite nicely through
: dosemu -- but I can't find that software, and my organization
: has *long* since discarded all that old DOS-based software media.
: 
: I've searched for a suitable solution several times in the past
: but I'm still unable to use Forms-based applications from within
: a *nix telnet session.  ;-(
: 
: *Surely* somebody out there is using a *nix-based system to
: communicate with a Vax-based Oracle application server who would
: be able to hand me a clue?
: 
UNIX is not a great platform for terminal emulators, since applications
do not have direct access to the screen buffer or to the keyboard.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-01  4:00 ISO VT320 emulator with key-bindings for Oracle Forms Frampton Steve R
  1999-06-02  4:00 ` Frank da Cruz
  1999-06-02  4:00 ` Walter Harms
@ 1999-06-02  4:00 ` Richard S. Shuford
  1999-06-03  4:00   ` Scott G. Hall
  2 siblings, 1 reply; 18+ messages in thread
From: Richard S. Shuford @ 1999-06-02  4:00 UTC (permalink / raw)


"Frampton Steve R" wrote:
>
> I'm in need of a VT320 emulator with key-bindings for Oracle
> SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
> Years ago I used something which I believe was called "setterm"
> or "sethost" (the name escapes)... a DOS-based application from
> Digital which I believe would fit the bill quite nicely....


The MS-DOS "sethost" application you recall was part of the
DECnet-DOS product.  I used it casually in 1991, but I believe
it was a pretty basic VT100 emulator.

You might profit from asking in Oracle-centric forums for favorite
methods of using "xmodmap" to adjust the keyboard settings for
"xterm".  The Xfree86 version of xterm is available here:

    http://www.clark.net/pub/dickey/xterm/xterm.html

Keep in mind that character-cell terminals communicate their
keystrokes by means of Escape sequences, as opposed to scan codes.
You must set up your keyboard so that, when you press a key, it sends
the proper Escape sequence to tell Oracle what action to perform.

Some terminal-related information is archived at

    http://www.cs.utk.edu/~shuford/terminal_index.html

(There is even a mention there of the Queens University Kermit
 program!  :-)

 ...RSS

-- 
Stratus Computer, Maynard, Massachusetts  http://www.stratus.com/
Redundant-hardware fault-tolerant computer systems running VOS or HP-UX.
This message does not contain the official opinion of Stratus.





^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-01  4:00 ISO VT320 emulator with key-bindings for Oracle Forms Frampton Steve R
  1999-06-02  4:00 ` Frank da Cruz
@ 1999-06-02  4:00 ` Walter Harms
  1999-06-02  4:00 ` Richard S. Shuford
  2 siblings, 0 replies; 18+ messages in thread
From: Walter Harms @ 1999-06-02  4:00 UTC (permalink / raw)


Frampton Steve R <3srf@qlink.queensu.ca> writes:

>Hello:

>I'm in need of a VT320 emulator with key-bindings for Oracle
>SQL*Forms; it needs to either run under Linux/Unix or else be
>an old DOS-based application that I can try running under
>"dosemu" (a Windows-based app through Wine would not be
>suitable, however).

basicly i should be possible to use the key-bindings in xterm. I have
the same problem but the solutions i got didnt work for me (didnt understand
why) but i havnt looked at the problem now for a while.

	walter

-- 
-----
"I am a highwayman, madam."
"This isn't a highway!"
-----



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-02  4:00 ` Richard S. Shuford
@ 1999-06-03  4:00   ` Scott G. Hall
  1999-06-03  4:00     ` Jeffrey Altman
  1999-06-03  4:00     ` Frank da Cruz
  0 siblings, 2 replies; 18+ messages in thread
From: Scott G. Hall @ 1999-06-03  4:00 UTC (permalink / raw)


"Richard S. Shuford" wrote:
> 
> "Frampton Steve R" wrote:
> > I'm in need of a VT320 emulator with key-bindings for Oracle
> > SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
> 
> Keep in mind that character-cell terminals communicate their
> keystrokes by means of Escape sequences, as opposed to scan codes.
> You must set up your keyboard so that, when you press a key, it sends
> the proper Escape sequence to tell Oracle what action to perform.
> 
> Some terminal-related information is archived at
> 
>     http://www.cs.utk.edu/~shuford/terminal_index.html
> 
> (There is even a mention there of the Queens University Kermit
>  program!  :-)

There is another regular poster to this newsgroup who is the author of
Kermit-95.  I believe that he emulates the VT-220 function keys correctly
so that it would work for you.  Let's hope he is reading this now, and
can reply if he has a version for UNIX.

-- 
Scott G. Hall
GTE Government Systems
North Carolina Systems Center
email: Scott.Hall@GSC.GTE.Com



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-03  4:00   ` Scott G. Hall
  1999-06-03  4:00     ` Jeffrey Altman
@ 1999-06-03  4:00     ` Frank da Cruz
  1999-06-08  4:00       ` Scott G. Hall
  1 sibling, 1 reply; 18+ messages in thread
From: Frank da Cruz @ 1999-06-03  4:00 UTC (permalink / raw)


In article <3756BEB7.E9CCD66F@GSC.GTE.Com>,
Scott G. Hall <Scott.Hall@GSC.GTE.Com> wrote:
: "Richard S. Shuford" wrote:
: > 
: > "Frampton Steve R" wrote:
: > > I'm in need of a VT320 emulator with key-bindings for Oracle
: > > SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
: > 
: > Keep in mind that character-cell terminals communicate their
: > keystrokes by means of Escape sequences, as opposed to scan codes.
: > You must set up your keyboard so that, when you press a key, it sends
: > the proper Escape sequence to tell Oracle what action to perform.
: > 
: > Some terminal-related information is archived at
: > 
: >     http://www.cs.utk.edu/~shuford/terminal_index.html
: > 
: > (There is even a mention there of the Queens University Kermit
: >  program!  :-)
: 
: There is another regular poster to this newsgroup who is the author of
: Kermit-95.  I believe that he emulates the VT-220 function keys correctly
: so that it would work for you.  Let's hope he is reading this now, and
: can reply if he has a version for UNIX.
: 
Sorry, we can't make terminal emulators for UNIX as we do for DOS and Windows,
since in UNIX we do not have direct access to the keyboard and screen.  How
is a UNIX application supposed to know that you pushed F7 on your keyboard,
or Ctrl-F8, or Alt-Right-Arrow, etc?  It usually doesn't even know what
kind of keyboard you have.  Remember that UNIX, unlike Windows and friends,
can be accessed:

 1. From the raw console (the workstation's physical keyboard and screen
    without any kind of window manager);
 2. From an X window, using the workstations real keyboard and screen;
 3. From an X window, but on some other computer;
 4. From a Telnet session (or Rlogin, etc);
 5. Through a serial port.

A terminal emulator might be possible in case (1), but there would need
to be a different one for every UNIX variety on every kind of hardware, so
it's not likely to happen.

A terminal emulator is possible in case (2), but you already have one.  It's
called xterm.  The regular xterm emulates vt100, and there is a vt220 version
available at:

  http://www.clark.net/pub/dickey/xterm/xterm.faq.html

Start xterm and then run Kermit in the xterm window and poof: you have a
terminal emulator that can make serial or network connections to other
computers.  Key mapping is handled by xterm.

For completeness, case 3 is kind of like case 2 maybe, and in cases 4 and 5
the UNIX application obviously can't get at your keyboard or screen.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-03  4:00   ` Scott G. Hall
@ 1999-06-03  4:00     ` Jeffrey Altman
  1999-06-03  4:00     ` Frank da Cruz
  1 sibling, 0 replies; 18+ messages in thread
From: Jeffrey Altman @ 1999-06-03  4:00 UTC (permalink / raw)


In article <3756BEB7.E9CCD66F@GSC.GTE.Com>,
Scott G. Hall <Scott.Hall@GSC.GTE.Com> wrote:
: "Richard S. Shuford" wrote:
: > 
: > "Frampton Steve R" wrote:
: > > I'm in need of a VT320 emulator with key-bindings for Oracle
: > > SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
: > 
: > Keep in mind that character-cell terminals communicate their
: > keystrokes by means of Escape sequences, as opposed to scan codes.
: > You must set up your keyboard so that, when you press a key, it sends
: > the proper Escape sequence to tell Oracle what action to perform.
: > 
: > Some terminal-related information is archived at
: > 
: >     http://www.cs.utk.edu/~shuford/terminal_index.html
: > 
: > (There is even a mention there of the Queens University Kermit
: >  program!  :-)
: 
: There is another regular poster to this newsgroup who is the author of
: Kermit-95.  I believe that he emulates the VT-220 function keys correctly
: so that it would work for you.  Let's hope he is reading this now, and
: can reply if he has a version for UNIX.

Scott, thanks for the mention.  Unfortunately, our Unix product, C-Kermit
does not provide terminal emulation.  Terminal emulation for C-Kermit is
provided by the Xterm (or other) window in which the process executes.
T.E. Dickey's Xterm is probably the best in this area providing VT220 
with keymapping:

 http://www.clark.net/pub/dickey/xterm/xterm.html

Depending upon how good dosemu is, the poster might be able to use
MS-DOS Kermit.  However, the biggest question that this user needs to
find an answer to is:

  what are the key-bindings for Oracle SQL*Forms?

If someone can provide that information, then I am sure that someone
else can provide a proper set of X Windows or Xterm key bindings.

    Jeffrey Altman * Sr.Software Designer * Kermit-95 for Win32 and OS/2
                 The Kermit Project * Columbia University
              612 West 115th St #716 * New York, NY * 10025
  http://www.kermit-project.org/k95.html * kermit-support@kermit-project.org



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-03  4:00     ` Frank da Cruz
@ 1999-06-08  4:00       ` Scott G. Hall
  1999-06-08  4:00         ` Frank da Cruz
  0 siblings, 1 reply; 18+ messages in thread
From: Scott G. Hall @ 1999-06-08  4:00 UTC (permalink / raw)
  To: Frank da Cruz

Frank da Cruz wrote:
> 
> Scott G. Hall <Scott.Hall@GSC.GTE.Com> wrote:
> : "Richard S. Shuford" wrote:
> : >
> : > "Frampton Steve R" wrote:
> : > > I'm in need of a VT320 emulator with key-bindings for Oracle
> : > > SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
> : >
> : > Keep in mind that character-cell terminals communicate their
> : > keystrokes by means of Escape sequences, as opposed to scan codes.
> :
> : There is another regular poster to this newsgroup who is the author of
> : Kermit-95.  I believe that he emulates the VT-220 function keys correctly
> : so that it would work for you.  Let's hope he is reading this now, and
> : can reply if he has a version for UNIX.
> :
> Sorry, we can't make terminal emulators for UNIX as we do for DOS and Windows,
> since in UNIX we do not have direct access to the keyboard and screen.  How
> is a UNIX application supposed to know that you pushed F7 on your keyboard,
> or Ctrl-F8, or Alt-Right-Arrow, etc?  It usually doesn't even know what
> kind of keyboard you have.

Standard terminfo stuff.  The program "cu" in the UUCP package is an example
of a terminal emulator for UNIX, but one that does no remapping.  It sets
the port in "raw" mode and reads the character from the terminal directly,
and just sends them on to the remote application.

A remapping terminal emulator would act just like cu, but when it gets the
characters from the terminal, if it receives the "Esc" character (or whatever
escape code defined by its term type in the terminfo capabilities database)
it checks for what capability the next several characters match.  Then it
sends the equivalent escape sequence to the remote application that matches
the same capability for the terminal being emulated.

Say for instance that you are working from a Sun console keyboard (term type
"sun"), and you want to emulate a VT-220 for a specific application.  When
the user would press the F6 key, the sun term type sends to your emulator
the escape sequence:  \E [ 2 2 9 z    The terminfo capability for this
keystroke is "kf6" or "the F6 key" for the sun term type.  The emulator
program would then output to the remote application the escape sequence:
\E [ 1 7 ~  , which is the terminfo capability "kf6" for a vt220 term type.

Same thing for escape codes read from the remote application.  If a match
is made for a capability being emulated, then the emulator sends proper
matching capability to the user's terminal.

This can be made independent easily by using the standard UNIX curses
library.  The library has calls for reading keystrokes and telling you
what key was pressed.  The library also has calls for sending to the user's
terminal the correct output codes, just by called the standard curses
functions.  So the emulator only needs to concern itself with the escape
codes that it is emulating, and leaves the escape code resolution for the
user's terminal screen and keyboard to the curses library.  In this way
the user can move from a Sun console to a Regent-60 without the emulator
knowing or caring.

> Remember that UNIX, unlike Windows and friends, can be accessed:
> 
>  1. From the raw console (the workstation's physical keyboard and screen
>     without any kind of window manager);
>  2. From an X window, using the workstations real keyboard and screen;
>  3. From an X window, but on some other computer;
>  4. From a Telnet session (or Rlogin, etc);
>  5. Through a serial port.

I think you misunderstand how UNIX works.  UNIX programs cannot access the
above directly, but rather access the user's terminal device node (the
special file for the terminal in the /dev/ hierarchy).  This is not
limited to serial devices, but any terminal device (a TCP port & its pseudo
port, or pty, a parallel port terminal, or others).

> A terminal emulator might be possible in case (1), but there would need
> to be a different one for every UNIX variety on every kind of hardware,
> so it's not likely to happen.

Nope.  The program uses curses to access the user's terminal, and this
becomes fully portable from terminal type to terminal type and port to
port.  Easily done.  In fact, I think there are commercial products for
several years doing just this.

> 
> A terminal emulator is possible in case (2), but you already have one.  It's
> called xterm.  The regular xterm emulates vt100, and there is a vt220 version
> available at:
> 
>   http://www.clark.net/pub/dickey/xterm/xterm.faq.html
> 
> Start xterm and then run Kermit in the xterm window and poof: you have a
> terminal emulator that can make serial or network connections to other
> computers.  Key mapping is handled by xterm.

And I have one that emulates a Wyse-60 w/Function keys, and Prime P-100
terminal, and a different one that emulates a Regent-60 w/Function keys.

-- 
Scott G. Hall
GTE Government Systems
North Carolina Systems Center
email: Scott.Hall@GSC.GTE.Com



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-08  4:00       ` Scott G. Hall
@ 1999-06-08  4:00         ` Frank da Cruz
  1999-06-09  4:00           ` Peter da Silva
  0 siblings, 1 reply; 18+ messages in thread
From: Frank da Cruz @ 1999-06-08  4:00 UTC (permalink / raw)


> Frank da Cruz wrote:
> > Scott G. Hall <Scott.Hall@GSC.GTE.Com> wrote:
> > : "Richard S. Shuford" wrote:
> > : > "Frampton Steve R" wrote:
> > : > > I'm in need of a VT320 emulator with key-bindings for Oracle
> > : > > SQL*Forms; it needs to either run under Linux/Unix or [in dosemu].
> > : >
> > : > Keep in mind that character-cell terminals communicate their
> > : > keystrokes by means of Escape sequences, as opposed to scan codes.
> > :
> > : There is another regular poster to this newsgroup who is the author of
> > : Kermit-95.  I believe that he emulates the VT-220 function keys correctly
> > : so that it would work for you.  Let's hope he is reading this now, and
> > : can reply if he has a version for UNIX.
> >
> > Sorry, we can't make terminal emulators for UNIX as we do for DOS and
> > Windows, since in UNIX we do not have direct access to the keyboard and
> > screen.  How is a UNIX application supposed to know that you pushed F7 on
> > your keyboard, or Ctrl-F8, or Alt-Right-Arrow, etc?  It usually doesn't
> > even know what kind of keyboard you have.
> 
> Standard terminfo stuff.  The program "cu" in the UUCP package is an example
> of a terminal emulator...
>
If cu is a terminal emulator, so is C-Kermit, and so are UNIX telnet and
rlogin.  But none of these are really terminal emulators -- they are
transparent communication pipes that give you a terminal session.

> A remapping terminal emulator would act just like cu, but when it gets the
> characters from the terminal, if it receives the "Esc" character (or
> whatever escape code defined by its term type in the terminfo capabilities
> database) it checks for what capability the next several characters match.
>
Yes, we know this, but the situation is far, FAR more complex than that.  Try
writing a communication program for UNIX that is:

 a. Portable to many UNIX varieties;
 b. Portable to assorted communication methods;
 c. Works on the console, in remote sessions, and in xterm windows.

Factor in that curses/termcap/terminfo libraries are:

 a. Buggy;
 b. Inconsistent among different UNIX platforms and versions (e.g. the
    APIs differ -- even a simple function like tputs() has practically
    infinite combinations of return type and argument types, thus preventing
    any program that uses it from being portable without including hundreds
    of #ifdefs);
 c. Dependent on buggy and/or incomplete databases;
 d. Offer only an incomplete and sketchy model of any real terminal,
    not even close to sufficient for defining an accurate emulation;
 e. Notorious for refusing to work due to library version mismatches;
 f. Sometimes not available at all.

And that in any case, this does not solve the original problem:

  How do I map Shift-Alt-F7 to such-and-such a function?

The answer will still be: "you can't, because the software has no way of
knowing that you pressed Shift-Alt-F7".
 
Furthermore, even when we give up on discovering what key the user actually
pressed and follow the termcap/terminfo escape-sequence model, we still have
the age-old problem of distinguishing the case where the user types the Esc
key and then some other keys (as s/he might do when using EMACS) from the case
where an escape sequence is generated by curses.  And no, we can't rely on
timings to distinguish these two cases because there is no guarantee, in the
general case, that a curses-generated escape sequence won't be broken into
separate IP packets that are routed in opposite directions around the world.

If it was easy (or even possible) to write terminal emulators for UNIX, we'd
have as many of them already floating around as we do for DOS and Windows.
After all UNIX has been with us since before 1970 -- long before DOS *or*
Windows.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-08  4:00         ` Frank da Cruz
@ 1999-06-09  4:00           ` Peter da Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Peter da Silva @ 1999-06-09  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4477 bytes --]

In article <7jjshc$ere$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
>Yes, we know this, but the situation is far, FAR more complex than that.  Try
>writing a communication program for UNIX that is:
>
> a. Portable to many UNIX varieties;
> b. Portable to assorted communication methods;

This can be handled by writing it as a wrapper around cu, kermit, tip,
or whatever. That way it'll even work for dumb programs that don't use
termcap.

> c. Works on the console, in remote sessions, and in xterm windows.

The latter case is not difficult. I wrote a termcap library back in '82,
and a vt100 and televideo emulator a few years later. If the system's 
termcap is broken, you can fall back to that one, and at least one of the
freeware "vi" clones uses my termcap for that very purpose.

> a. Buggy;
> b. Inconsistent among different UNIX platforms and versions (e.g. the
>    APIs differ -- even a simple function like tputs() has practically
>    infinite combinations of return type and argument types, thus preventing
>    any program that uses it from being portable without including hundreds
>    of #ifdefs);

I haven't run into this problem, and I've written and ported an awful lot of
curses-based code between UNIX systems. Some code did a good job of
encapsulating the slight differences between implemetations of the termlib
API, and other code made no attempt to hide system dependencies and just
scattered ifdefs all over the place. Even otherwise well-written code like
early versions of Kermit had that problem.

> c. Dependent on buggy and/or incomplete databases;

That's something the end-user can fix.

> d. Offer only an incomplete and sketchy model of any real terminal,
>    not even close to sufficient for defining an accurate emulation;

My vt100 emulator, which used raw termlib, did a better job of vt100
emulation than most commercial packages.  It didn't try and provide
perfect visuals: double-wide and double-high letters, for example, were
simply not addressed. But it passed the vt100 torture test.

> e. Notorious for refusing to work due to library version mismatches;
> f. Sometimes not available at all.

That's an easy fix. Same solution as B.

>And that in any case, this does not solve the original problem:
>
>  How do I map Shift-Alt-F7 to such-and-such a function?
>
>The answer will still be: "you can't, because the software has no way of
>knowing that you pressed Shift-Alt-F7".

With a keyboard mapping file that maps escape sequences to symbols that
the user's interested in.

>Furthermore, even when we give up on discovering what key the user actually
>pressed and follow the termcap/terminfo escape-sequence model, we still have
>the age-old problem of distinguishing the case where the user types the Esc
>key and then some other keys (as s/he might do when using EMACS) from the case
>where an escape sequence is generated by curses.

Oh yes, that's definitely a problem, but there's nothing any terminal emulator
can resolve, UNIX-based or not, because once it's mapped "UP" into "ESC O A"
or "ESC [ A" the bits on the wire are the same.

>If it was easy (or even possible) to write terminal emulators for UNIX, we'd
>have as many of them already floating around as we do for DOS and Windows.

Well, most modern UNIX systems come with an X-based VT100 emulator and there's
an X-based 3270 emulator from the same source available. There's not much
demand for curses-based emulators, because almost all UNIX software uses
termlib... the last time I had to configure a UNIX program for a terminal
was for the text editor in Intel's PL/M development kit back around 1984.

But there's at least a dozen commercial terminal emulators for UNIX... back
when I wrote my own (so we could run VMS software on our mix of Televideo
and Unisys tubes) I must have looked at six or eight of them just for
Xenix-286 (which was admittedly the #1 selling UNIX at the time). None of
them allowed you to wrap an arbitrary program, alas, and that was a hard
requirement.

Since then xterm and x3270 have become what Eric Raymond calls "category
killers". There's little demand for third-party free software alternates,
though that didn't stop rxvt from showing up. And I still get ads in the
mail for things like FacetTerm.

-- 
In hoc signo hack, Peter da Silva <peter@baileynm.com>
 `-_-'   Ar rug t� barr�g ar do mhact�re inniu? 
  'U`    "Be vewy vewy quiet...I'm hunting Jedi." -- Darth Fudd




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
@ 1999-06-10  4:00 Frank da Cruz
  1999-06-10  4:00 ` Frank da Cruz
  1999-06-11  4:00 ` Peter da Silva
  0 siblings, 2 replies; 18+ messages in thread
From: Frank da Cruz @ 1999-06-10  4:00 UTC (permalink / raw)


peter@baileynm.com (Peter da Silva) wrote:
: In article <7jjshc$ere$1@newsmaster.cc.columbia.edu>,
: Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
: > ...
: > b. Inconsistent among different UNIX platforms and versions (e.g. the
: >    APIs differ -- even a simple function like tputs() has practically
: >    infinite combinations of return type and argument types, thus preventing
: >    any program that uses it from being portable without including hundreds
: >    of #ifdefs);
: 
: I haven't run into this problem, and I've written and ported an awful lot of
: curses-based code between UNIX systems. Some code did a good job of
: encapsulating the slight differences between implemetations of the termlib
: API, and other code made no attempt to hide system dependencies and just
: scattered ifdefs all over the place. Even otherwise well-written code like
: early versions of Kermit had that problem.
: 
tputs() can be void or int.  The third argument of tputs(), which is a pointer
to a function to put a character, can be void, int, or char.  The argument
to that function can be void or char.  Thus there are at least 2 x 3 x 2 = 12
combinations that must be accounted for in any portable code that uses tputs().
Probably more like 30 when you take into account that int or char can be
signed or unsigned.  Of course the ugliness is encapsulated, but that doesn't
make any less ugly.  I have never understood the force impels UNIX
implementors to change data types of widely used APIs every time they get a
chance.

: > c. Dependent on buggy and/or incomplete databases;
: 
: That's something the end-user can fix.
: 
If the end-user knows how to.  This is a rather obscure and dying art; one
does not rely on end-users to have mastery of it.  In these times, end-users
expect software to "just work".

: > d. Offer only an incomplete and sketchy model of any real terminal,
: >    not even close to sufficient for defining an accurate emulation;
: 
: My vt100 emulator, which used raw termlib, did a better job of vt100
: emulation than most commercial packages.  It didn't try and provide
: perfect visuals: double-wide and double-high letters, for example, were
: simply not addressed. But it passed the vt100 torture test.
: 
Then it didn't run strictly from termcap/terminfo information; otherwise, it
wouldn't have been a vt100 emulator, it would have been an emulator of every
terminal that had an entry in the database, right?  The database only encodes
certain information about a terminal, not all the information needed to make
a fully functional emulator.  Such items as report requests and responses,
forms-filling, and blockmode spring to mind.

: > e. Notorious for refusing to work due to library version mismatches;
: > f. Sometimes not available at all.
: 
: That's an easy fix. Same solution as B.
: 
It's easy if you understand cryptic messages about shared libraries, and
are familiar with the politics regarding curses vs ncurses, libc vs glibc,
competing numbering schemes, etc, and what to do about them.

: >And that in any case, this does not solve the original problem:
: >
: >  How do I map Shift-Alt-F7 to such-and-such a function?
: >
: >The answer will still be: "you can't, because the software has no way of
: >knowing that you pressed Shift-Alt-F7".
: 
: With a keyboard mapping file that maps escape sequences to symbols that
: the user's interested in.
: 
If xmodmap recognizes your keyboard and can see Shift-Alt-F7 as distinct from
other key combinations, then yes, but only for xterm.  A separate solution is
required for the console.  Remote (non-X) sessions haven't a prayer.

You win some and lose some.  UNIX is a general-purpose multiuser operating
system designed originally to be accessed from a terminal, and in fact a
variety of terminals.  The idea of a UNIX workstation with its own keyboard
and screen was grafted on later and is still not a good fit.

DOS and Windows, on the other hand, are single-user operating systems designed
to be used ONLY from the built-in keyboard, mouse, and screen, and therefore
include APIs (or direct hardware access) that make terminal emulation possible
in the sense that most people expect.  But this is at the expense of
generalized accessibility.

It is hard to explain this to people who expect UNIX to be like Windows.
While it might be possible to write a true terminal emulator for a specific
UNIX variety on specific hardware that runs only in an X window (and in fact
there are numerous examples -- xterm, Xfree86 xterm, the xterm versions from
HP, IBM, and other companies that emulate their own proprietary terminal
types), it is not possible in the general case, due to differences in hardware
(e.g. different keyboards), windowing systems (in the X environment), screen
drivers (in the console environment), APIs, and access methods.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-10  4:00 Frank da Cruz
@ 1999-06-10  4:00 ` Frank da Cruz
  1999-06-11  4:00   ` Peter da Silva
  1999-06-11  4:00 ` Peter da Silva
  1 sibling, 1 reply; 18+ messages in thread
From: Frank da Cruz @ 1999-06-10  4:00 UTC (permalink / raw)


In article <7johsh$egs$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
: peter@baileynm.com (Peter da Silva) wrote:
: : ...
: : My vt100 emulator, which used raw termlib, did a better job of vt100
: : emulation than most commercial packages.  It didn't try and provide
: : perfect visuals: double-wide and double-high letters, for example, were
: : simply not addressed. But it passed the vt100 torture test.
: : 
: Then it didn't run strictly from termcap/terminfo information; otherwise, it
: wouldn't have been a vt100 emulator, it would have been an emulator of every
: terminal that had an entry in the database, right?
:
Oops, that was written before the morning's coffee has soaked in.  Peter's
point is (obviously) that he is using termcap info for the local terminal
(whatever it is) to translate between it and a remote VT100.  The VT100
knowledge is hardcoded, but knowledge about the local terminal is table
driven.

Depending on the capabilities of the local terminal (e.g. scrolling
regions, 80/132-column switching, etc), a serviceable termlib-based vt100
emulator might be possible, to the extent it is useable by EMACS or vi, but
not necessarily by more demanding applications, such as those found on VMS.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-10  4:00 Frank da Cruz
  1999-06-10  4:00 ` Frank da Cruz
@ 1999-06-11  4:00 ` Peter da Silva
  1999-06-11  4:00   ` Frank da Cruz
  1 sibling, 1 reply; 18+ messages in thread
From: Peter da Silva @ 1999-06-11  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 5561 bytes --]

In article <7johsh$egs$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
>tputs() can be void or int.  The third argument of tputs(), which is a pointer
>to a function to put a character, can be void, int, or char.  The argument
>to that function can be void or char.  Thus there are at least 2 x 3 x 2 = 12
>combinations that must be accounted for in any portable code that uses tputs().

Luckily you don't need to account for it by writing 12 versions of the code.
I normally encapsulate tputs itself into a routine (the name I usually use
is "outs"), and since C specifies that (char) promotes to (int) in fuction
call and return, that leaves you with two versions of the call to tputs
and two versions of the output function, in one place in the code.

>: > c. Dependent on buggy and/or incomplete databases;

>: That's something the end-user can fix.

>If the end-user knows how to.  This is a rather obscure and dying art; one
>does not rely on end-users to have mastery of it.  In these times, end-users
>expect software to "just work".

End users who aren't using ANSI X3.64 compatible terminals in 1999 are already
at the extreme end of the envelope.

>: > d. Offer only an incomplete and sketchy model of any real terminal,
>: >    not even close to sufficient for defining an accurate emulation;

>: My vt100 emulator, which used raw termlib, did a better job of vt100
>: emulation than most commercial packages.  It didn't try and provide
>: perfect visuals: double-wide and double-high letters, for example, were
>: simply not addressed. But it passed the vt100 torture test.

>Then it didn't run strictly from termcap/terminfo information; otherwise, it
>wouldn't have been a vt100 emulator, it would have been an emulator of every
>terminal that had an entry in the database, right?

No, it was a vt100 emulator that emulated the vt100 on every terminal in the
database.

> The database only encodes
>certain information about a terminal, not all the information needed to make
>a fully functional emulator.  Such items as report requests and responses,
>forms-filling, and blockmode spring to mind.

Luckily I haven't ever had to deal with that on a vt100. Virtually all the
software I've ever run into that used block mode used it on a Televideo,
a Televideo-compatible, or a Uniscope.

But there's nothing inherently more difficult about dealing with block
mode than dealing with any of the other behaviour termcap doesn't specify.

>: > e. Notorious for refusing to work due to library version mismatches;
>: > f. Sometimes not available at all.

>: That's an easy fix. Same solution as B.

>It's easy if you understand cryptic messages about shared libraries, and
>are familiar with the politics regarding curses vs ncurses, libc vs glibc,
>competing numbering schemes, etc, and what to do about them.

I haven't run into that, but then I haven't writen code for Linux.

>: >And that in any case, this does not solve the original problem:

>: >  How do I map Shift-Alt-F7 to such-and-such a function?

>: >The answer will still be: "you can't, because the software has no way of
>: >knowing that you pressed Shift-Alt-F7".

>: With a keyboard mapping file that maps escape sequences to symbols that
>: the user's interested in.

>If xmodmap recognizes your keyboard and can see Shift-Alt-F7 as distinct from
>other key combinations, then yes, but only for xterm.  A separate solution is
>required for the console.  Remote (non-X) sessions haven't a prayer.

Where did I say anything about xmodmap? I'm simply saying that a properly
written terminal emulator can run on UNIX and provide the functionality
required. That there isn't one that you know of is because there isn't a great
need for one, not that one's hard to write. As I said, I wrote one that ran
on Xenix-286, Solaris, and System V back in the late '80s. It was a port from
a DOS program I'd previously written, and I didn't find the porting
particularly difficult. Certainly dealing with termcap was a lot less hassle
than dealing with PC serial ports.

>It is hard to explain this to people who expect UNIX to be like Windows.
>While it might be possible to write a true terminal emulator for a specific
>UNIX variety on specific hardware that runs only in an X window (and in fact
>there are numerous examples -- xterm, Xfree86 xterm, the xterm versions from
>HP, IBM, and other companies that emulate their own proprietary terminal
>types), it is not possible in the general case, due to differences in hardware
>(e.g. different keyboards), windowing systems (in the X environment), screen
>drivers (in the console environment), APIs, and access methods.

That's just plain not true. Curses provides all the functionality you need
to write one that is portable to multiple UNIX systems and runs under multiple
terminal types. Yes, you do need to write your own keyboard mapping code, but
then you already have to do that to write a terminal emulator under Windows
that runs on internationalized versions.

I've done it myself, and there were several companies back in the '80s who had
commercial products that ran on a wide variety of UNIX platforms... I used
to have half a dozen boxes back in the computer room but they seem to have been
flushed in one of the spring cleanings. You can do as good a job of vt100
emulation on a UNIX system as you can on a PC.

-- 
In hoc signo hack, Peter da Silva <peter@baileynm.com>
 `-_-'   Ar rug t� barr�g ar do mhact�re inniu? 
  'U`    "Be vewy vewy quiet...I'm hunting Jedi." -- Darth Fudd




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-10  4:00 ` Frank da Cruz
@ 1999-06-11  4:00   ` Peter da Silva
  1999-06-11  4:00     ` T.E.Dickey
  0 siblings, 1 reply; 18+ messages in thread
From: Peter da Silva @ 1999-06-11  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

In article <7jokj1$h6u$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
>Depending on the capabilities of the local terminal (e.g. scrolling
>regions, 80/132-column switching, etc), a serviceable termlib-based vt100
>emulator might be possible, to the extent it is useable by EMACS or vi, but
>not necessarily by more demanding applications, such as those found on VMS.

I wrote mine because I needed one that was servicable on VMS. The hard part
of serving DEC software (on VMS and RSX-11) wasn't rendering things well
enough to be usable, but recognising the oddball undocumented variants of
the VT100 escape sequences that DEC software spit out.

Scrolling regions, for example, were emulated by insert and delete line, or
if that failed by repainting either the scrolled region or the remainder of
the screen (whichever was quicker, and after shifting the whole screen in the
latter case).

I didn't complete the 80-132 column code, but I did have it working by
shifting the whole screen left and right without the cursor tracking and
other heuristics to avoid driving users batty with page flips. It was just
too much hassle for something that I knew people would simply not use, so
I told them that wasn't an option.

But at the end I had the only VT100 emulator I could find at the time that
was usable with BOTH RSX-11 and VMS versions of EDT and TPU, even if it
wasn't always as pretty as a real vt100. And it ran on UNIX.

-- 
In hoc signo hack, Peter da Silva <peter@baileynm.com>
 `-_-'   Ar rug t� barr�g ar do mhact�re inniu? 
  'U`    "Be vewy vewy quiet...I'm hunting Jedi." -- Darth Fudd




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-11  4:00 ` Peter da Silva
@ 1999-06-11  4:00   ` Frank da Cruz
  1999-06-12  4:00     ` Peter da Silva
  0 siblings, 1 reply; 18+ messages in thread
From: Frank da Cruz @ 1999-06-11  4:00 UTC (permalink / raw)


In article <7jr2s5$4sc@web.nmti.com>,
Peter da Silva <peter@baileynm.com> wrote:
: In article <7johsh$egs$1@newsmaster.cc.columbia.edu>,
: Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
: >: >And that in any case, this does not solve the original problem:
: >: >
: >: >  How do I map Shift-Alt-F7 to such-and-such a function?
: >: > 
: >: >The answer will still be: "you can't, because the software has no way of
: >: >knowing that you pressed Shift-Alt-F7".
: >: > 
: >: With a keyboard mapping file that maps escape sequences to symbols that
: >: the user's interested in.
: 
: >If xmodmap recognizes your keyboard and can see Shift-Alt-F7 as distinct
: >from other key combinations, then yes, but only for xterm.  A separate
: >solution is required for the console.  Remote (non-X) sessions haven't a
: >prayer.
: 
: Where did I say anything about xmodmap? I'm simply saying that a properly
: written terminal emulator can run on UNIX and provide the functionality
: required. That there isn't one that you know of is because there isn't a
: great need for one, not that one's hard to write.
: 
Sorry, didn't mean to infer statements you didn't make -- after all,
we "da"'s have to stick together :-)

But again: in general, there is no API in UNIX to get the keycode of a
keyboard event.

PC operating systems like DOS and Windows let you do this at various
levels: per-key up/down events ("make/break codes") at the lowest level,
keycodes representing a composite event (such as "Shift-Alt-F7 was pressed")
at the next level, and ASCII characters at the top level.  In general, UNIX
only gives you the top level.

If you have an X application, you can get keycodes.  If your non-X application
is running in an X window, then it will get a stream of ASCII which results
from the X keymap.  A stream of ASCII characters is inherently ambiguous.  If
you get <ESC>OD, is it because the user pressed the Left Arrow key, or because
s/he pressed the Esc key, then the O key, then the D key?

If your application is running on the raw console, it *could* get keycodes or
raw key events but there is, in general, no API for this.  Specific UNIX
varieties and versions *might* have such an API, but it will not be portable,
and it can't be used when the application is coming in a serial port, or on
a Telnet or Rlogin connection, or for that matter, in X.

Case in point -- Linux has obscure ways to put the console keyboard into
"raw" or "half-cooked" mode, but these are rarely used -- not only because
they are obscure, but because if your application messes up (e.g. crashes)
without putting the keyboard back the way it found it upon exit, you'll need
to pull the plug on your PC before you can use it again.

- Frank



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-11  4:00   ` Peter da Silva
@ 1999-06-11  4:00     ` T.E.Dickey
  1999-06-12  4:00       ` Peter da Silva
  0 siblings, 1 reply; 18+ messages in thread
From: T.E.Dickey @ 1999-06-11  4:00 UTC (permalink / raw)


In comp.os.linux.networking Peter da Silva <peter@baileynm.com> wrote:

> But at the end I had the only VT100 emulator I could find at the time that
> was usable with BOTH RSX-11 and VMS versions of EDT and TPU, even if it
> wasn't always as pretty as a real vt100. And it ran on UNIX.

can we download this and play with it?

-- 
Thomas E. Dickey
dickey@clark.net
http://www.clark.net/pub/dickey



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-11  4:00     ` T.E.Dickey
@ 1999-06-12  4:00       ` Peter da Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Peter da Silva @ 1999-06-12  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

In article <Rfa83.209$S2.8876@iad-read.news.verio.net>,
T.E.Dickey <dickey@shell.clark.net> wrote:
>In comp.os.linux.networking Peter da Silva <peter@baileynm.com> wrote:
>> But at the end I had the only VT100 emulator I could find at the time that
>> was usable with BOTH RSX-11 and VMS versions of EDT and TPU, even if it
>> wasn't always as pretty as a real vt100. And it ran on UNIX.

>can we download this and play with it?

I'll see if I can (a) dig up a copy of it, and (b) get it released.

-- 
In hoc signo hack, Peter da Silva <peter@baileynm.com>
 `-_-'   Ar rug t� barr�g ar do mhact�re inniu? 
  'U`    "Be vewy vewy quiet...I'm hunting Jedi." -- Darth Fudd




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: ISO VT320 emulator with key-bindings for Oracle Forms
  1999-06-11  4:00   ` Frank da Cruz
@ 1999-06-12  4:00     ` Peter da Silva
  0 siblings, 0 replies; 18+ messages in thread
From: Peter da Silva @ 1999-06-12  4:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

In article <7jr6lr$4f1$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
>But again: in general, there is no API in UNIX to get the keycode of a
>keyboard event.

Assuming that's what you want, no. However there is an API in UNIX to
get a string of one or more characters that represent a keystroke, and
for non-pathological cases that's all you need.

After all, we ARE talking about a terminal emulator. Yes, you can get
escape sequences garbled over communication lines that don't maintain
time information. But there's two cases we need to consider here:

	1. The terminal emulator is "close" to the keyboard.

	Here, time information is preserved, the emulator can reliably
	distinguish keystrokes. This is the case of a PC or a UNIX program
	running on a console or in an X terminal.

	2. The terminal emulator is far from the keyboard.

	Here, it isn't. But remember that the other side of the terminal
	emulator is also generating escape sequences that are subject to
	the same problem... so a PC-based terminal emulator would have
	the same trouble getting ITS escape sequences reliably recognised,
	since it would have to run close to the keyboard and far from the
	application.

The only case I can think of where there's a problem is if the input
escape sequence (from the keyboard to the emulator) is less reliably
recognised then the output one (from the emulator to the application),
or if the emulator is running on a significantly overloaded computer.

If you need to distinguish codes (like shift-alt-F7 versus alt-F7) that 
the OS doesn't provide a hook for, then you have a problem, but this,
like the heavily overloaded computer, is a pretty pathological case.

After all, international PC keyboards give you bigger problems than this.

I haven't figured out how to generate a seperate "~" on some spanish
keyboards, for example.

-- 
In hoc signo hack, Peter da Silva <peter@baileynm.com>
 `-_-'   Ar rug t� barr�g ar do mhact�re inniu? 
  'U`    "Be vewy vewy quiet...I'm hunting Jedi." -- Darth Fudd




^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~1999-06-12  4:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-06-01  4:00 ISO VT320 emulator with key-bindings for Oracle Forms Frampton Steve R
1999-06-02  4:00 ` Frank da Cruz
1999-06-02  4:00 ` Walter Harms
1999-06-02  4:00 ` Richard S. Shuford
1999-06-03  4:00   ` Scott G. Hall
1999-06-03  4:00     ` Jeffrey Altman
1999-06-03  4:00     ` Frank da Cruz
1999-06-08  4:00       ` Scott G. Hall
1999-06-08  4:00         ` Frank da Cruz
1999-06-09  4:00           ` Peter da Silva
  -- strict thread matches above, loose matches on Subject: below --
1999-06-10  4:00 Frank da Cruz
1999-06-10  4:00 ` Frank da Cruz
1999-06-11  4:00   ` Peter da Silva
1999-06-11  4:00     ` T.E.Dickey
1999-06-12  4:00       ` Peter da Silva
1999-06-11  4:00 ` Peter da Silva
1999-06-11  4:00   ` Frank da Cruz
1999-06-12  4:00     ` Peter da Silva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox