public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Trouble with /dev/pts
@ 2007-05-21 22:02 Rick Moseley
  2007-05-22 13:40 ` Roland McGrath
  0 siblings, 1 reply; 2+ messages in thread
From: Rick Moseley @ 2007-05-21 22:02 UTC (permalink / raw)
  To: frysk

Hi all,

I've been working on having the source window bring up a gnome terminal 
that a task's STDIN/STDOUT/STDERR can be assigned to when it is started 
up.  I am using the org.gnu.gnomevte.Terminal class to perform this 
function. There are two ways to instantiate the Terminal class, one way 
is with parameters which allows the user to select a task to execute, 
command line arguments and a default working directory.  It is used like 
this:

    vte = new Terminal("/bin/bash", null, null);

This works fine for me as it creates a new entry in "/dev/pts" for the 
terminal I/O and it stays alive.  I can then fire up a small task and 
redirect its STD?? to that /dev/pts and it works fine except for the 
initial input which bash intercepts.  But after that the task takes 
input from the terminal window and outputs there fine too.  If I 
terminate the bash shell associated with this gnome terminal, the 
/dev/pts entry goes away but the window remains.

The second way of instantiating the Terminal class is without any 
parameters, which is the way I would prefer to use it so the task that 
gets activated does not fight with bash for control of the terminal I/O.

    vte = new Terminal();

This does pop up a gnome terminal, but looking at /dev/pts, there has 
not been allocated any pts assigned to this window.  None.

I have the above scenario running outside of frysk.  When I activate a 
task using the frysk mechanism of 
frysk.proc.Manager.host.requestCreateAttachedProc I see a slightly 
different result.  When using the afore-mentioned method to activate a 
task, three of the parameters are passed to it correspond to 
STDIN/OUT/ERR.  When I use this mechanism(which uses the "new 
Terminal()" way of creating a gnome terminal), I do indeed see a new 
/dev/pts entry for the window and the newly activated task does indeed 
write to it on start-up.  The task I activate is a perpetual looper, so 
it stays in the cpu queue until I kill it.  After about a minute or two, 
the entry in /dev/pts for the gnome terminal disappears rendering the 
gnome terminal useless.

Bottom line is, I would like to activate a gnome terminal and have a 
permanent /dev/pts attached/assigned to it.  I'm not exactly sure how to 
do that except to use the Terminal instantiation with a bash shell 
attached, which is unacceptable.

Does I/O have to be perpetually assigned to the /dev/pts entry for it to 
remain?  Or something like that?

Any info/ideas is/are appreciated.

Thanks,

Rick


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

* Re: Trouble with /dev/pts
  2007-05-21 22:02 Trouble with /dev/pts Rick Moseley
@ 2007-05-22 13:40 ` Roland McGrath
  0 siblings, 0 replies; 2+ messages in thread
From: Roland McGrath @ 2007-05-22 13:40 UTC (permalink / raw)
  To: Rick Moseley; +Cc: frysk

> Does I/O have to be perpetually assigned to the /dev/pts entry for it to 
> remain?  Or something like that?

You just have to keep the pty master fd open.

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

end of thread, other threads:[~2007-05-21 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-21 22:02 Trouble with /dev/pts Rick Moseley
2007-05-22 13:40 ` Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).