diff options
Diffstat (limited to 'lib/IO')
-rw-r--r-- | lib/IO/Pty/Easy.pm | 9 |
1 files 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; } # }}} |