Path: utzoo!attcan!uunet!mcrware!jejones From: jejones@mcrware.UUCP (James Jones) Newsgroups: comp.sys.m6809 Subject: Re: Shell in a Window Summary: path #3, eh? sounds like it's time to dup() Message-ID: <706@mcrware.UUCP> Date: 11 Jun 88 10:57:45 GMT References: <1988Jun10.101254.14923@lsuc.uucp> Distribution: na Organization: Microware Systems Corp., Des Moines, Ia. Lines: 46 In article <1988Jun10.101254.14923@lsuc.uucp>, jimomura@lsuc.uucp (Jim Omura) writes: > 2. In this device window, I've openned up an overlay window with > OWSet(). Now, I want to run a Shell in that overlay window. > Nothing I've tried has worked. Testing indicates that the > 'path' number is always 3. SS.DevNm returns a device 'W'. I think that what you'll want to do is something like this: in the program that opens the overlay window, savein = dup(0); saveout = dup(1); saveerr = dup(2); close(0); close(1); close(2); /* * Of course, "3" in the following should be replaced by a variable that * holds the path number from opening the overlay window! */ dup(3); /* will get stdin in the overlay window*/ dup(3); /* will get stdout */ dup(3); /* will get stderr */ /* *now* fork the shell */ close(0); close(1); close(2); dup(savein); /* put back stdin --order is important here! */ dup(saveout); /* put back stdout */ dup(saveerr); /* put back stderr */ close(savein); close(saveout); close(saverr); On the other hand, there's always system("shell <>>>/3"); since the CoCo 3 shell will take / to mean the path with that number. James Jones