From b3f1bda4fc4015d1fef9e6ba07e5340b7b41308c Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 5 Mar 2012 02:19:59 -0600 Subject: this doesn't really make sense if stdin/stdout aren't attached to a tty --- lib/Term/Filter.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/Term/Filter.pm b/lib/Term/Filter.pm index 9969895..9172fc2 100644 --- a/lib/Term/Filter.pm +++ b/lib/Term/Filter.pm @@ -149,6 +149,9 @@ sub _setup { my $self = shift; my (@cmd) = @_; + Carp::croak("Must be run attached to a tty") + unless -t $self->input && -t $self->output; + $self->pty->spawn(@cmd) || Carp::croak("Couldn't spawn @cmd: $!"); $self->_raw_mode(1); -- cgit v1.2.3