[comp.windows.x] Help Requested with Xview's TTY Subwindows

demillo@porter.geo.brown.edu (Rob DeMillo) (05/22/91)

I am in the middle of authoring and X Application that I
had intended to use multiple TTY Subwindows on, but I have
ran into difficulty:

When I open up a single TTY subwindow, my program behaves
normally. With more then one TTY window open, Xview seems
to confuse stdin and stdout. (output intended for one window
winds up in another, etc etc etc.) I have checked my code
about, oh, a billion times, and I don't believe the problem is
with me. I know that SunView had a restriction on the number of
TTY subwindows to 1, because it couldn't keep track of
all of the stdio. Is the same limitation imposed on XView?

I am doing this all on a SPARC station running OpenWindows.

Please mail me any responses that have, and I'll summarize if 
people want me to...

Thanks in advance...


- Rob


 - Rob DeMillo			     | Internet: demillo@juliet.ll.mit.edu
   Mass Inst of Tech/Lincoln Lab     | Also:     demillo@porter.geo.brown.edu
   Weather Sensing Project-Group 43  | Reality:  401-273-0804 (home)
"I say you *are* the Messiah, Lord! And I ought to know, I've followed a few!"

jcb@NCD.COM (Jim Becker) (05/22/91)

demillo@porter.geo.brown.edu (Rob DeMillo) writes:

    I am in the middle of authoring and X Application that I
    had intended to use multiple TTY Subwindows on, but I have
    ran into difficulty:

    When I open up a single TTY subwindow, my program behaves
    normally. With more then one TTY window open, Xview seems
    to confuse stdin and stdout. (output intended for one window
    winds up in another, etc etc etc.) I have checked my code
    about, oh, a billion times, and I don't believe the problem is
    with me. I know that SunView had a restriction on the number of
    TTY subwindows to 1, because it couldn't keep track of
    all of the stdio. Is the same limitation imposed on XView?

     - Rob DeMillo


the XView ttysw and textsw code was not designed to be reentrant,  and
you  will  have  mysterious problems when trying to have more than one
ttysw or textsw active at one time.

(this is not heresay, i was responsible for the code at Sun.)

-Jim Becker	(eX-XView Group Member)

-- 

--
 -Jim Becker / jcb@ncd.com   /   Network Computing Devices, Inc. (NCD)

d87-pjn@sm.luth.se (P-O Jacobson) (05/24/91)

demillo@porter.geo.brown.edu (Rob DeMillo) writes:

>I am in the middle of authoring and X Application that I
>had intended to use multiple TTY Subwindows on, but I have
>ran into difficulty:

We are in the coming few days supposed to complete a small X-program
here on the university.
A small problem has arised, tough:  We can't find a proper way of
opening some kind of a tty attached to a window, so that it later
on can be used for stdin, stdout and stderr.

Our confusion has lead us to the following UGLY solution:

1) Open an pty
2) fork()
3) execvp("xterm",args) where args includes "-S%c%c%d" where
   %c%c is the last two chars in the filename of the pty and
   %d is the number of the inherited filedescriptor.

This gives us an hanging xshell process that we can't control,
but we do get the tty we wanted to!!

Our question is: How do we get the tty we want, and still be able
to look our teachers in the eyes afterwards???

Any help is appreciated, the faster the better. The program is due
on tuesday.  :-(

P.S we are working on a SUN station using X11R4 and the twm
    window manager

	P-O Jacobson   (d87-pjn@sm.luth.se) and
        Hakan Hellberg (d86-hhg@sm.luth.se)

-------------------------------------------------------------------------------
    P-O Jacobson
    Internet : d87-pjn@sm.luth.se		
    UUCP     : {uunet,mcvax}!sunic.se!sm.luth.se!d87-pjn   
    University of Lulea,Sweden.                             
-------------------------------------------------------------------------------