From 3bc41559c600a1b10a87bb13e2ba24d1a17021c8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 6 Mar 2012 01:22:58 -0600 Subject: update for new Term::Filter api --- lib/App/Termcast.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index 6aa1c0e..778bb81 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -8,7 +8,7 @@ use IO::Select; use IO::Socket::INET; use JSON; use Scalar::Util 'weaken'; -use Term::Filter; +use Term::Filter::Callback; use Term::ReadKey; use Try::Tiny; @@ -251,13 +251,20 @@ has _needs_termsize_update => ( has _term => ( is => 'ro', - isa => 'Term::Filter', + does => 'Term::Filter', lazy => 1, predicate => '_has_term', default => sub { my $_self = shift; weaken(my $self = $_self); - Term::Filter->new( + # XXX using ::Callback for now because we need to be able to + # instantiate App::Termcast objects without initializing the terminal + # (in case of just calling write_to_termcast). This should + # eventually be deprecated in favor of moving the termcast interaction + # code out to an App::Termcast::Writer module or something, and + # this module should be a simple wrapper that combines that module + # with Term::Filter. + Term::Filter::Callback->new( callbacks => { setup => sub { my ($term) = @_; -- cgit v1.2.3-54-g00ecf