From: N. W. <nor...@ar...> - 2006-11-20 23:40:02
|
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); |