In article <20011001021246.M24225@alpha.hut.fi>, "Jarkko Hietaniemi"
<jhi@iki.fi> wrote:
> I guess one could try running stty -g, if succesful (no error code), save away
> the output, and on completion restore using that.
Something like this?
-- c
--- lib/Term/~Complete.t Sun Sep 30 18:13:15 2001
+++ lib/Term/Complete.t Sun Sep 30 18:13:17 2001
@@ -8,6 +8,11 @@
use warnings;
use Test::More tests => 8;
use vars qw( $Term::Complete::complete $complete );
+my $restore;
+
+END {
+ `stty $restore`;
+}
SKIP: {
skip('PERL_SKIP_TTY_TEST', 8) if $ENV{PERL_SKIP_TTY_TEST};
@@ -18,7 +23,9 @@
if (defined $TTY) {
open(TTY, $TTY) or die "open $TTY failed: $!";
skip("$TTY not a tty", 8) if defined $TTY && ! -t TTY;
- }
+ $restore = `stty -g`;
+ skip("Can't reliably restore $TTY", 8) if $?;
+ }
use_ok( 'Term::Complete' );
Thread Previous
|
Thread Next