diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-07-06 22:46:53 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-07-06 22:46:53 -0500 |
commit | d4247cdd28a32f5c9eca291239df5ddb93cd9e1d (patch) | |
tree | bda1b6463d741042243599f15652ec36a4cd774b | |
parent | 29cbb0e6922d5c73a78ad907e468d60f3f99168a (diff) | |
download | app-termcast-d4247cdd28a32f5c9eca291239df5ddb93cd9e1d.tar.gz app-termcast-d4247cdd28a32f5c9eca291239df5ddb93cd9e1d.zip |
the pty object is the actual io handle now
-rw-r--r-- | lib/App/Termcast.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index b5476fd..11ea3e2 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -53,14 +53,14 @@ sub run { my $pty = IO::Pty::Easy->new; $pty->spawn(@argv); my $termios = POSIX::Termios->new; - $termios->getattr(fileno($pty->{pty})); + $termios->getattr(fileno($pty)); my $lflag = $termios->getlflag; $termios->setlflag($lflag | POSIX::ECHO); - $termios->setattr(fileno($pty->{pty}), POSIX::TCSANOW); + $termios->setattr(fileno($pty), POSIX::TCSANOW); my ($rin, $rout) = ''; vec($rin, fileno(STDIN) ,1) = 1; - vec($rin, fileno($pty->{pty}), 1) = 1; + vec($rin, fileno($pty), 1) = 1; ReadMode 4; while (1) { my $ready = select($rout = $rin, undef, undef, undef); @@ -73,7 +73,7 @@ sub run { } $pty->write($buf); } - if (vec($rout, fileno($pty->{pty}), 1)) { + if (vec($rout, fileno($pty), 1)) { my $buf = $pty->read(0); if (!$buf) { warn "Error reading from pty: $!" unless defined $buf; |