summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-07-06 21:16:51 -0500
committerJesse Luehrs <doy@tozt.net>2009-07-06 21:16:51 -0500
commit86169d0080ea4da02407b077841a616c379a347f (patch)
tree9de5db3a43c2d66789f1e80bcdee4cac5859106c
parentc6190fc6c63cbd51b2343934325984d6c502a3ac (diff)
downloadapp-termcast-86169d0080ea4da02407b077841a616c379a347f.tar.gz
app-termcast-86169d0080ea4da02407b077841a616c379a347f.zip
aha, echo was off by default on spawned processes
-rw-r--r--lib/App/Termcast.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/App/Termcast.pm b/lib/App/Termcast.pm
index a5bf717..c0e7077 100644
--- a/lib/App/Termcast.pm
+++ b/lib/App/Termcast.pm
@@ -52,6 +52,11 @@ sub run {
my $pty = IO::Pty::Easy->new;
$pty->spawn(@argv);
+ my $termios = POSIX::Termios->new;
+ $termios->getattr(fileno($pty->{pty}));
+ my $lflag = $termios->getlflag;
+ $termios->setlflag($lflag | POSIX::ECHO);
+ $termios->setattr(fileno($pty->{pty}), POSIX::TCSANOW);
my ($rin, $rout) = '';
vec($rin, fileno(STDIN) ,1) = 1;