texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[6313] run stty sane conditionally


From: Gavin D. Smith
Subject: [6313] run stty sane conditionally
Date: Sat, 06 Jun 2015 15:36:23 +0000

Revision: 6313
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6313
Author:   gavin
Date:     2015-06-06 15:36:22 +0000 (Sat, 06 Jun 2015)
Log Message:
-----------
run stty sane conditionally

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/t/Init-inter.inc
    trunk/info/t/Init-test.inc
    trunk/info/t/Timeout-test.inc

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-06-06 14:08:36 UTC (rev 6312)
+++ trunk/ChangeLog     2015-06-06 15:36:22 UTC (rev 6313)
@@ -1,5 +1,13 @@
 2015-06-06  Gavin Smith  <address@hidden>
 
+       * info/t/Init-test.inc,
+       * info/t/Init-inter.inc: Check if running the test turned off 
+       terminal echoing, and only run "stty sane" if that is the case.
+       * info/t/Timeout-test.inc: Default exit status of test to 
+       success.
+
+2015-06-06  Gavin Smith  <address@hidden>
+
        * info/t/index-apropos.sh: Wait for 'index-apropos' command to 
        finish before we sent more key strokes.
 

Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2015-06-06 14:08:36 UTC (rev 6312)
+++ trunk/info/t/Init-inter.inc 2015-06-06 15:36:22 UTC (rev 6313)
@@ -61,8 +61,9 @@
 
 FINISHEDFIFO=t/`basename $0.finished`
 
-# See cleanup in Init-test.inc
-findprog stty && STTY=stty
+# See cleanup in Init-test.inc.
+findprog stty && { STTY=stty ; reset_required=yes ; }
+test $reset_required=yes && { $STTY | grep [-]echo ; } && reset_required=no
 
 # Create named pipes to communicate with pseudotty program, or quit.
 rm -f $PIPEIN $PTY_TYPE # must already be defined

Modified: trunk/info/t/Init-test.inc
===================================================================
--- trunk/info/t/Init-test.inc  2015-06-06 14:08:36 UTC (rev 6312)
+++ trunk/info/t/Init-test.inc  2015-06-06 15:36:22 UTC (rev 6313)
@@ -57,6 +57,7 @@
 
 # For interactive tests, we try to set this in Init-inter.inc
 STTY=true
+reset_required=no
 
 # Clean up if the test is interrupted, for example if the user types
 # C-c, to avoid lingering child processes.  Signal 2 is SIGINT.
@@ -73,15 +74,16 @@
   rm -f $PIPEIN $PTY_TYPE
   rm -f $FINISHEDFIFO
   
-  if test -n "$TIMED_OUT"; then
-    return 1
-  fi
-
   # We do this because some versions of ksh93 (including that in
   # Solaris 11) have a bug where a timed-out "read -t" can mess up
   # the terminal settings, leading to characters not being echoed.
-  $STTY sane
+  # This is only done if we don't start with "-echo" at the beginning.
+  test $reset_required = yes && { $STTY | grep '[-]echo' ; } && $STTY sane
 
+  if test -n "$TIMED_OUT"; then
+    exit 1
+  fi
+
   #killall `basename $0`  # see below
   exit $RETVAL
 }

Modified: trunk/info/t/Timeout-test.inc
===================================================================
--- trunk/info/t/Timeout-test.inc       2015-06-06 14:08:36 UTC (rev 6312)
+++ trunk/info/t/Timeout-test.inc       2015-06-06 15:36:22 UTC (rev 6313)
@@ -29,6 +29,7 @@
   status=$?
 fi
 
+RETVAL=0
 if test $status = 1; then
   echo 'read -t failed - probably end-of-file' >&2
   RETVAL=1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]