diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-03-06 01:22:58 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-03-06 01:22:58 -0600 |
commit | 3bc41559c600a1b10a87bb13e2ba24d1a17021c8 (patch) | |
tree | 9dcf65bc3837e70617452cf70f437e521a22a5b4 | |
parent | 78ee25dfbd4088039ae508e4b2dd26646c2734f0 (diff) | |
download | app-termcast-3bc41559c600a1b10a87bb13e2ba24d1a17021c8.tar.gz app-termcast-3bc41559c600a1b10a87bb13e2ba24d1a17021c8.zip |
update for new Term::Filter api
-rw-r--r-- | lib/App/Termcast.pm | 13 |
1 files 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) = @_; |