texinfo-commits
[Top][All Lists]
Advanced

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

[6935] tcsetattr in pseudotty to disable special characters


From: Gavin D. Smith
Subject: [6935] tcsetattr in pseudotty to disable special characters
Date: Wed, 13 Jan 2016 12:30:39 +0000

Revision: 6935
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6935
Author:   gavin
Date:     2016-01-13 12:30:01 +0000 (Wed, 13 Jan 2016)
Log Message:
-----------
tcsetattr in pseudotty to disable special characters

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/pseudotty.c
    trunk/info/t/Init-inter.inc
    trunk/info/t/c-u-m-x-scroll-forward.sh
    trunk/info/t/gc-split.sh
    trunk/info/t/inc-sea-forward-nonregex.sh
    trunk/info/t/inc-sea-forward.sh
    trunk/info/t/inc-sea-history.sh
    trunk/info/t/inc-sea-insensitive.sh

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/ChangeLog     2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,3 +1,17 @@
+2016-01-13  Gavin Smith  <address@hidden>
+
+       * info/t/Init-inter.inc (synch_with_program): Remove function.
+       * info/t/c-u-m-x-scroll-forward.sh,
+       * info/t/inc-sea-forward.sh,
+       * info/t/inc-sea-history.sh,
+       * info/t/inc-sea-insensitive.sh,
+       * info/t/inc-sea-forward-nonregex.sh,
+       * info/t/gc-split.sh: Don't call it.  It could lead to an 
+       infinite loop if the program had already exited, and also slowed 
+       down the tests.
+       * info/pseudotty.c: Call tcsetattr to turn off special 
+       characters like C-u and C-s.
+
 2016-01-11  Gavin Smith  <address@hidden>
 
        * tp/Texinfo/Convert/XSParagraph/Makefile.am: Print error if 

Modified: trunk/info/pseudotty.c
===================================================================
--- trunk/info/pseudotty.c      2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/pseudotty.c      2016-01-13 12:30:01 UTC (rev 6935)
@@ -2,7 +2,7 @@
    standard output.  Read and ignore any data sent to terminal.  This
    is so we can run tests interactively without messing up the screen.
 
-   Copyright 2014, 2015 Free Software Foundation, Inc.
+   Copyright 2014, 2015, 2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -20,9 +20,7 @@
    Originally written by Gavin Smith.  */
 
 #define _XOPEN_SOURCE 600
-/* SunOS 5.10 on SPARC doesn't allow compilation in C99 mode with
-   _XOPEN_SOURCE with a smaller value (and the gnulib stdarg module
-   puts us in C99 mode. */
+/* for posix_openpt */
 
 #include <config.h>
 #include <errno.h>
@@ -89,6 +87,23 @@
   */
 #endif
 
+#if defined (HAVE_TERMIOS_H)
+  {
+  struct termios t;
+  if (tcgetattr (slave, &t) == -1)
+    error (0, 0, "error calling tcgetattr");
+  else
+    {
+      t.c_cc[VSTART] = -1; /* C-q */
+      t.c_cc[VSTOP] = -1;  /* C-s */
+      t.c_cc[VKILL] = -1;  /* C-u */
+      t.c_cc[VINTR] = -1;  /* C-c */
+      if (tcsetattr (slave, TCSANOW, &t) == -1)
+        error (0, 0, "error calling tcsetattr");
+    }
+  }
+#endif
+
 #if defined (TIOCSWINSZ)
   {
     struct winsize ws;

Modified: trunk/info/t/Init-inter.inc
===================================================================
--- trunk/info/t/Init-inter.inc 2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/t/Init-inter.inc 2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -160,13 +160,5 @@
     echo 'pgrep program not found - cannot get PID of ginfo process' >&2
     GINFO_PID=unknown
   fi
+  test x$GINFO_PID = xunknown
 }
-
-synch_with_program ()
-{
-  # Wait for the program to do its terminal initialization, so that
-  # bytes like C-u and C-s will not be special.
-  printf D >$PTY_TYPE
-  while test ! -f $GINFO_OUTPUT ; do sleep 1 ; done
-  rm -f $GINFO_OUTPUT
-}

Modified: trunk/info/t/c-u-m-x-scroll-forward.sh
===================================================================
--- trunk/info/t/c-u-m-x-scroll-forward.sh      2016-01-11 20:22:40 UTC (rev 
6934)
+++ trunk/info/t/c-u-m-x-scroll-forward.sh      2016-01-13 12:30:01 UTC (rev 
6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -30,8 +30,6 @@
 
 run_ginfo -f intera -n 'Scroll four lines'
 
-synch_with_program
-
 # C-u M-x scroll-forward should scroll four lines, not four screens
 printf '\025\033xscroll-forward\r' >$PTY_TYPE
 printf '\rDq' >$PTY_TYPE

Modified: trunk/info/t/gc-split.sh
===================================================================
--- trunk/info/t/gc-split.sh    2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/t/gc-split.sh    2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 . $t/Init-inter.inc
 
 run_ginfo -f split
-synch_with_program
 # Cause the garbage collector to run in a split file by cancelling an 
 # incremental search.  Refresh the screen afterwards to increase the 
 # chances of trying to access freed file contents.

Modified: trunk/info/t/inc-sea-forward-nonregex.sh
===================================================================
--- trunk/info/t/inc-sea-forward-nonregex.sh    2016-01-11 20:22:40 UTC (rev 
6934)
+++ trunk/info/t/inc-sea-forward-nonregex.sh    2016-01-13 12:30:01 UTC (rev 
6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 . $t/Init-inter.inc
 
 run_ginfo -f search
-synch_with_program
 
 # Turn off regular expressions, and search for "match" with incremental
 # search.  Test deleting characters from search string with backspace.  Go

Modified: trunk/info/t/inc-sea-forward.sh
===================================================================
--- trunk/info/t/inc-sea-forward.sh     2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/t/inc-sea-forward.sh     2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 . $t/Init-inter.inc
 
 run_ginfo -f search
-synch_with_program
 
 # Search for "match" with incremental search.  Test deleting characters from
 # search string with backspace.  Go forward to match in next node.  Test

Modified: trunk/info/t/inc-sea-history.sh
===================================================================
--- trunk/info/t/inc-sea-history.sh     2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/t/inc-sea-history.sh     2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014, 2015 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,7 @@
 . $t/Init-inter.inc
 
 run_ginfo -f inc-sea-history
-synch_with_program
+
 # Check that we go back to the right node after an incremental search
 printf '\02301234\b4\b\b34\b\bqwerty\b\b\b\b\b\b34' >$PTY_TYPE
 printf '\rD' >$PTY_TYPE

Modified: trunk/info/t/inc-sea-insensitive.sh
===================================================================
--- trunk/info/t/inc-sea-insensitive.sh 2016-01-11 20:22:40 UTC (rev 6934)
+++ trunk/info/t/inc-sea-insensitive.sh 2016-01-13 12:30:01 UTC (rev 6935)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# Copyright (C) 2014 Free Software Foundation, Inc.
+# Copyright (C) 2014, 2015, 2016 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@
 . $t/Init-inter.inc
 
 run_ginfo -f intera -n 'Incremental search case-insensitive'
-synch_with_program
 
 # Search for "match" with incremental search, adding an upper-case character
 # to make the search case-sensitive.  Delete it and check the search goes back




reply via email to

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