diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-03-05 02:19:59 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-03-05 02:19:59 -0600 |
commit | b3f1bda4fc4015d1fef9e6ba07e5340b7b41308c (patch) | |
tree | 91d9ef8e839bb9e341422e6bfb86fd9ffb14956f /lib/Term | |
parent | 906c4ab3946a60af6b843529c67da272bebdd95e (diff) | |
download | term-filter-b3f1bda4fc4015d1fef9e6ba07e5340b7b41308c.tar.gz term-filter-b3f1bda4fc4015d1fef9e6ba07e5340b7b41308c.zip |
this doesn't really make sense if stdin/stdout aren't attached to a tty
Diffstat (limited to 'lib/Term')
-rw-r--r-- | lib/Term/Filter.pm | 3 |
1 files changed, 3 insertions, 0 deletions
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); |