Browse Prior Art Database

Teletypewriter Input/Output Through a Motif Interface in AIX

IP.com Disclosure Number: IPCOM000114922D
Original Publication Date: 1995-Feb-01
Included in the Prior Art Database: 2005-Mar-30
Document File: 4 page(s) / 99K

Publishing Venue

IBM

Related People

Amin, SA: AUTHOR [+4]

Abstract

A Motif* application does not necessarily have a Teletypewriter (TTY) device associated with it. This can be a problem for Motif programs which execute other programs. These children processes may display messages or require input from a TTY device which is different from normal standard input (stdin) and standard output (stdout/stderr). This solution allows the user to see and respond to messages displayed to the TTY device (/dev/tty) in a Motif interface.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 53% of the total text.

Teletypewriter Input/Output Through a Motif Interface in AIX

      A Motif* application does not necessarily have a Teletypewriter
(TTY) device associated with it.  This can be a problem for Motif
programs which execute other programs.  These children processes may
display messages or require input from a TTY device which is
different from normal standard input (stdin) and standard output
(stdout/stderr).  This solution allows the user to see and respond to
messages displayed to the TTY device (/dev/tty) in a Motif interface.

Background:

      Most programs which execute other programs can easily capture
the standard input and output of their child processes.  Sometimes
the child process must interact with the user before continuing.  An
example of this is when install prompts the user to insert the next
tape and press Enter to continue.  The child process can open the TTY
device (/dev/tty) directly and interact with it instead of sending
the output to the standard location which is captured by the parent
process.  For non-graphical applications this is generally okay since
the application is running in a TTY device and the messages come to
the same screen with which the user is currently interacting.  An
example of this is the Curses version of SMIT (smitty).  While the
command is running, any TTY messages are immediately displayed and
any user input is directed to the TTY device because the user is
running in a TTY device.  If the same command is run from a Motif
application, any messages directed to the TTY would generally appear
in the aixterm or console from which the Motif application was
started.  Aside from the sloppy appearance, the aixterm or console
may not be visible on the screen and the user would be unaware that
interaction was required.

Description of Invention:

      This invention consists of a method to capture TTY input/output
and display it in a Motif text window in which the user can interact.
The standard input/output is also captured and displayed so the user
is able to see that as well.

Flowchart:
  The basic method is to:
  o  Open an unused pty device.  On the AIX** platform this can be
      accomplished with an open(/dev/ptc) call.;
  o  Fork the child process:
     -  Dup the stdin, stdout, and stderr of the child process to the
         named tty from the open of the pty;
     -  Exec the child process;
     -  Read from the pty device;
     -  Display output in text window;
     -  Check for keyboard input in text window, send keyboard input
         to the pty dev...