Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Confirming X02zlevi test failures



2014/11/23 12:3, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> OK, so maybe what we needed all along instead of those zpty_flush calls
> was to have a timeout delay.

Sorry, my post was not clear enough.
I need BOTH zpty_flush and '-t 0.02' to get 1000/1000 success.
With zpty_flush only, I got 998/1000 success on Mac (1000/1000 on FreeBSD).

So this is a kind of yet another workaround.
But the result supports your guess that clearing the buffer of the slave
tty would be important.


diff --git a/Test/comptest b/Test/comptest
index c67237a..5964114 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -34,7 +34,7 @@ comptestinit () {
 "fpath=( $fpath )" \
 "bindkey -$comptest_keymap" \
 'LISTMAX=10000000
-stty 38400 columns 80 rows 24 werase undef tabs
+stty 38400 columns 80 rows 24 tabs -icanon -iexten
 TERM=vt100
 KEYTIMEOUT=1
 setopt zle
@@ -162,9 +162,9 @@ comptest () {
 zletest () {
   local first=0
   for input; do
+    zpty_flush Before zletest
     # sleep for $KEYTIMEOUT
-    (( first++ )) && read -t 0.011 -k 1 < /dev/null
-    # zpty_flush Before zletest
+    (( first++ )) && read -t 0.02 -k 1 < /dev/null
     zpty -n -w zsh "$input"
   done
   zpty -n -w zsh $'\C-X'
@@ -172,6 +172,6 @@ zletest () {
     print "failed to invoke finish widget."
     return 1
   }
-  # zpty_flush After zletest
+  zpty_flush After zletest
   print -lr "${(@)${(@ps:\r\n:)log##*<WIDGET><finish>}[2,-2]}"
 }




Messages sorted by: Reverse Date, Date, Thread, Author