You access GNU Readline variables through the Attribs method (with the rl_ stripped). Term::ReadLine::Gnu_Variables
#!/usr/bin/perl use strict; use warnings; use Term::ReadLine; $SIG{TERM} = sub { print "I got a TERM\n"; exit; }; $SIG{INT} = sub { print "I got a INT\n"; exit; }; # add any additional signal handlers you want my $term = Term::ReadLine->new('Term1'); $term->ornaments(0); my $attribs = $term->Attribs; $attribs->{catch_signals} = 0; # the default is 1 my $prompt = 'cmd> '; while ( defined (my $cmd = $term->readline($prompt)) ) { chomp($cmd); if ($cmd =~ /^help$/) { print "Help Menu\n"; } else { print "Nothing\n"; } }
Update: Added $SIG{INT}
In reply to Re: Perl Term::ReadLine::Gnu Signal Handling Difficulties
by Mr. Muskrat
in thread Perl Term::ReadLine::Gnu Signal Handling Difficulties
by sgt_b2002
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |