develooper Front page | perl.perl5.porters | Postings from October 2001

Re: [ID 20010929.014] Term::Complete screws up -ixon

Thread Previous | Thread Next
Benjamin Goldberg
October 1, 2001 13:08
Re: [ID 20010929.014] Term::Complete screws up -ixon
Message ID:
Rafael Garcia-Suarez wrote:
> On 2001.09.30 01:07 Nicholas Clark wrote:
> >
> > I'm not enough of a terminal wizard to know why the routines:
> >           $tty_raw_noecho = "$stty raw -echo";
> >           $tty_restore    = "$stty -raw echo";
> >
> > don't do what they should, or whether a stty -all can be used
> > instead to capture terminal output and restore it perfectly (so
> > sorry, no patch), but I'd hope that something can be done to fix
> > this irritating bug.
> On Solaris and Linux, you can use `stty -g`. This outputs a string
> that can be given back as parameter to stty to restore the terminal
> state.
> But I don't know whether it's portable.

Nothing using stty seems to be highly portable.

It seems to me that instead of having code scatered throughout Term::
and elsewhere which calls on the stty program, we should have a pragma
or module which encapsulates the functionality.  This one module could
be configured appropriately on a per-system basis, so as to try really
hard [at installation time, not at runtime], to get it right.

use IO::Stty;
{ my $save = stty(qw(raw -echo));
  # do stuff with raw on and echo off.

Or something like that...

Besides looking at stty and seeing what arguments it accepts, it could
also try and use ioctl, which is even more nonportable, but which should
be much faster than calling an external program.

"I think not," said Descartes, and promptly disappeared.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About