Subject: Re: I/O xterm through Tcl/Tk - DN [1]


Don Libes <libes@nist.gov> - 30 Mar 1999 - comp.lang.tcl

 Alexandre Ferrieux <alexandre.ferrieux@cnet.francetelecom.fr> writes:
 > Don Libes wrote:
 > > Alexandre Ferrieux <alexandre.ferrieux@cnet.francetelecom.fr> writes:
 > > }  A possibility (very dirty and non-portable) would be to somehow gain
 > > } access to the master pty (the one in which xterm writes to talk to the
 > > } child's input). For Solaris at least it already seems pretty hard, since
 > > } now ptys are handled through the cloning ptmx master...
 > >
 > > Actually, xterm has a flag (-S) specifically to support what the
 > > original poster requested.  The Expect book shows how to use it.
 >
 > Wow ! Thanks for putting my nose into this ! Nevr noticed...
 > Now looking at the manpage on Solaris leaves me completely baffled:
 >
 >     -Sccn    This option specifies the last two letters  of  the
 >             name  of a pseudoterminal to use in slave mode, plus
 >             the number of the inherited  file  descriptor.   The
 >             option  is  parsed ``%c%c%d''.  This allows xterm to
 >             be used as an input and output channel for an exist-
 >             ing  program  and  is  sometimes used in specialized
 >             applications.
 >
 > Can you please explain and/or give an example ?

 Yes, that man page is rather unhelpful.  Here's a simpler explanation:

 1) Generate a pty.
 2) Tell xterm about it via the -S flag.
 3) Characters written to the pty appear in the xterm window.
    Characters typed into the xterm appear in the pty.

 Notice there is no child process!  You can create one but it's not
 necessary - it just depends on what you're trying to accomplish.
 Either way, you can do some pretty neat things with this.

 Don

Last modified
1999-09-27

(195.108.246.50)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated