Hello,
When I run this script,
#!/usr/bin/perl
use Term::ReadLine;
use sigtrap 'handler' => \&myhand, 'INT';
sub myhand
{
print "\n caught $SIG{INT}",@_,"\n";
}
my $term = Term::ReadLine->new('test');
print $term->ReadLine()."\n";
$term->readline("try CTRL-C in some text here :");
I get a «^C» character displayed when I hit CTRL-C, but the signal is only processed once I type the Enter key. Here is the output :
marcel@machine:/tmp$ perl test.pl
Term::ReadLine::Gnu
try CTRL-C in some text here :auie ^C
caught CODE(0x558c9e99acb0)INT
marcel@machine:/tmp$
How can I catch it sooner ? Thanks.
Note : I use $term->AddDefun() and $term->bind_keyseq() to catch CTRL-UP/DOWN successfully, but this appears to be limited to some keys. I can't bind to CTRL-Enter for instance as I don't get a key-sequence as I do for CTRL-UP. Is this all related ?