From: Roland G. <rgi...@cp...> - 2006-12-16 18:01:37
|
The problem is that this is extremely system-dependent, as ptys are different from OS to OS. It may be /dev/pts/3 or /dev/ptx3 or ... xterm on the other hand seems to use the BSD-style /dev/ptyp3 (taking the "p3" via -S). Unfortunately there is no way to force IO::Tty to only use the BSD-style ptys. You might be able to open the /dev/ttypX-/dev/ptypX pairs manually (like tcl does) and use them via exp_init(). A much better way (for all of us!) would be to patch xterm to take a complete path to a pty with the -S option (I'm wondering why nobody already did this) in a backward-compatible way... Sorry, I don't see an easy solution to this... Servus aus Wien! Roland On 11/21/06, N. Weuster <nor...@ar...> wrote: > hello, > > as Expect/Tcl/multixterm is not an option on my systems, I am trying to port > multixterm (spawning xterms with expect) to perl using Expect.pm. In > multixterm it looks so easy. > > At the moment I got stuck, finding the right slave parameters for xterm > "-S". > > Have anyone already tried so and could advise? > > kind regards > Norbert > > > xterm-man page: > -Sccn 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 the xterm command to be used as an > input and output channel for an existing program and is sometimes used in > specialized applications. > > my approaches: > $object=new Expect(); > $object->slave->stty(qw(raw -echo)); > $ptyname=$object->slave->ttyname(); > $ptyno=fileparse($ptyname); > # print "ptyname=$ptyname ptyno=$ptyno\n"; > $no2= $ptyno % 10; > $no1= ( $ptyno - $no2 ) / 10 ; > $PTYHANDLE=$object->pty_handle(); print "PTYHANDLE=$PTYHANDLE\n"; > $command="xterm"; > $fno1=fileno($object); > $fno2=fileno($object->slave()); > # print "fno1:$fno1 fno2:$fno2 \n"; > @parameter= ("-S$no1${no2}????????????"); > @stats1=stat ($object); > @stats2=stat ($object->slave()); > print "stats1:@stats1\nstats2:@stats2\n"; > $object->spawn($command, @parameter); > > > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > Expectperl-discuss mailing list > Exp...@li... > https://lists.sourceforge.net/lists/listinfo/expectperl-discuss > > > > |