From b60c8a20f48e8db075b0d3cbd0557295b2fa2c69 Mon Sep 17 00:00:00 2001 From: doy Date: Tue, 3 Feb 2009 03:53:54 -0500 Subject: clean up signals a bit better --- lib/IO/Pty/Easy.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/IO/Pty/Easy.pm b/lib/IO/Pty/Easy.pm index 9d2256a..4cf1973 100644 --- a/lib/IO/Pty/Easy.pm +++ b/lib/IO/Pty/Easy.pm @@ -254,9 +254,12 @@ Returns whether or not a subprocess is currently running on the pty. sub is_active { my $self = shift; - return 0 unless defined($self->{pid}); - my $active = kill 0 => $self->{pid}; - delete $self->{pid} unless $active; + my $active = defined($self->{pid}); + $active = kill 0 => $self->{pid} if $active; + if (!$active) { + delete $self->{pid}; + $SIG{WINCH} = 'DEFAULT'; + } return $active; } # }}} -- cgit v1.2.3-54-g00ecf