diff options
author | Jesse Luehrs <doy@tozt.net> | 2009-07-05 22:39:54 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2009-07-05 22:39:54 -0500 |
commit | c6190fc6c63cbd51b2343934325984d6c502a3ac (patch) | |
tree | 1352d83fdd23d1ef755c1acabc9a828cee43b49d | |
parent | 1f05ffce2ad265c686a7cb113e2b2f5e2fbc3046 (diff) | |
download | app-termcast-c6190fc6c63cbd51b2343934325984d6c502a3ac.tar.gz app-termcast-c6190fc6c63cbd51b2343934325984d6c502a3ac.zip |
better terminal setting handling
-rw-r--r-- | lib/App/Termcast.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm index a189060..a5bf717 100644 --- a/lib/App/Termcast.pm +++ b/lib/App/Termcast.pm @@ -46,8 +46,6 @@ sub run { my @argv = @{ $self->extra_argv }; push @argv, ($ENV{SHELL} || '/bin/sh') if !@argv; - ReadMode 3; - my $socket = IO::Socket::INET->new(PeerAddr => $self->host, PeerPort => $self->port); $socket->write('hello '.$self->user.' '.$self->password."\n"); @@ -58,6 +56,7 @@ sub run { my ($rin, $rout) = ''; vec($rin, fileno(STDIN) ,1) = 1; vec($rin, fileno($pty->{pty}), 1) = 1; + ReadMode 4; while (1) { my $ready = select($rout = $rin, undef, undef, undef); if (vec($rout, fileno(STDIN), 1)) { @@ -79,6 +78,7 @@ sub run { $socket->write($buf); } } + ReadMode 0; } __PACKAGE__->meta->make_immutable; |