From: Bryan B. <br...@bu...> - 2008-12-12 16:18:08
|
> On Fri, Dec 12, 2008 at 08:46:45AM -0500, Bryan Bueter wrote: >> As for running mutt through expect, it seems to ignore everything >> i send, even if I just try and open it up quit. So I dont think >> there is actually anything wrong with what your sending, just how >> its being interpreted by mutt. > > Mutt works just fine seding "j" keys; you have to expect something > to see the updates though. > > How about this; I've got an example that uses "less", which pretty > much everybody should have. Run: > > seq 1 500 >/tmp/crap > > Then try this code: > > - ---------------------- > > #!/usr/bin/perl > > use warnings; > use strict; > > use Expect; > > my $timeout = 5; > > $Expect::Log_Stdout = 1; > #$Expect::Debug = 1; > #$Expect::Exp_Internal = 1; > > my $exp; > > $exp = new Expect (); > > $exp->raw_pty(1); > > $exp = Expect->spawn("/usr/bin/less", "/tmp/crap") or die "Cannot spawn > client: $!\n"; > > $exp->log_file( "/tmp/exp.out", "w" ); > > $exp->expect($timeout, "crap" ); > print "done expect.\n"; > > $exp->send("\c[[B"); > $exp->send("\c[[B"); > $exp->send("\e[B"); > > $exp->expect($timeout, "26" ); > > sleep 5; > > print "done arrows.\n"; > > $exp->send("j"); > $exp->send("j"); > $exp->send("j"); > sleep 5; > > $exp->expect($timeout, "26" ); > > $exp->send("q"); > sleep 5; > > $exp->expect($timeout, "crap" ); > > print "Done sending.\n"; > > - ---------------------- > > As you can see, the arrow keys do nothing, but the j keys work just > fine. > > -Robin Ok i think i fixed your issue, which appears to be a termcap problem. Try running any one of your scripts, but change your TERM environment variable to one of vt220, linux, putty, sun, cygwin, or asni (looks like crap but works) and you should be fine. There are probably more, but those are the ones i tested that worked. Hope that helps. Bryan Bueter http://sourceforge.net/projects/rover |