Add signal handlers for SIGINT, SIGCHLD and terminal resize events
This commit is contained in:
parent
747db0fe15
commit
31203d82fc
1 changed files with 5 additions and 0 deletions
|
@ -15,6 +15,11 @@ my $env = Environment::SQLite->new(
|
|||
db_path => 'pshell_env.db'
|
||||
);
|
||||
|
||||
# Signal handling setup
|
||||
$SIG{INT} = sub { print "\n"; };
|
||||
$SIG{CHLD} = 'IGNORE';
|
||||
$SIG{WINCH} = sub { $term->resize_terminal if defined $term };
|
||||
|
||||
print "Perl Shell (pshell) - Type 'exit' to quit\n";
|
||||
|
||||
my $term = Term::ReadLine->new('pshell');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue