From 31203d82fc84cecdd24af9fee8cbc5762234b65f Mon Sep 17 00:00:00 2001 From: kake26 Date: Mon, 14 Apr 2025 15:24:59 -0500 Subject: [PATCH] Add signal handlers for SIGINT, SIGCHLD and terminal resize events --- pshell.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pshell.pl b/pshell.pl index c973a0e..ec9439a 100755 --- a/pshell.pl +++ b/pshell.pl @@ -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');