[comp.sys.next] Subprocess example

sritchie@cs.ubc.ca (Stuart Ritchie) (04/13/91)

4 days for BlastApp eh Ali?  Gee does your boss know you
spend your time writing games all day?  If not, don't 
worry we won't tell, and keep it up!!! :-)
---
Big help needed:

I have a tty application which would really benefit from a
NeXTstep interface slapped on top of it.  And there's even
NextDeveloper/Examples/Subprocess which implements a class
that allows the NeXTstep side to talk asynchronously through
pipes to the tty app's stdin/stdout.  Wow what could be
easier!

But I cannot seem to get the Subprocess example program,
MyShell, to work properly.  The MyShell app is supposed to
display a ScrollView and allow the user to type shell commands
and see the associated shell output.

When I run MyShell, any commands I type in the ScrollView are
echoed IN A COMPLETELY DIFFERENT SHELL window elsewhere on the
screen!  The command are not executed.  Focusing on this
particular shell (Terminal) window, and typing commands reveals
that it is totally confused.  After exiting MyShell, the
Terminal window remains confused.

I've spent some time looking at the Subprocess code, but my
understanding of pseudo-tty's is sparse.  I found
that Subprocess grabs the first available pty to talk with
the tty application.  The pty it grabs, however, already
belongs to a shell window on my screen.  Hence the confusion
experienced above.  Is this proper behaviour?

I tried my own simple test using Subprocess without pseudo-tty
support.  Things sort of worked, except that the NeXTstep side
would not receive any output until the tty app exists (I think
this is when it receives an EOF).

Sorry for the long winded description, but you really have
to see it to believe what's going on here.  Can anyone offer
a few clues?  (Joe Freeman where are you!!!? :-)

Thanks!!!
----
Stuart   <sritchie@cs.ubc.ca>   Wot's...uh the deal?