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

Re: Commit 137b15a fails X02zlevi test



On Feb 16,  2:07am, Jun T. wrote:
} Subject: Re: Commit 137b15a fails X02zlevi test
}
} The problem is the '^R' sent by zletest $'123\C-_\e\C-r'.
} The slave-side zsh should set its tty input into non-canonical mode
} when Zle is active, but I suspect that it fails (or delays) to do so
} and the ^R does has a effect of reprint.

Ah!  That makes sense.  I was assuming character were lost because
the master was reading while the slave was writing, but it's just as
likely that the master writes while the slave is busy.  I wan't
thinking about how stty controls affect "typeahead".

} Maybe the only call of zpty_flush necessary is
} 'zpty_flush After comptesteval'
} in comptesteval(); all the other zpty_flush call can be removed.
} With this single call of zpty_flush and ^R --> ^K, all the test pass
} on Mac and FreeBSD (without adding sleep anywhere).

OK, same here -- let's go with this, then.


diff --git a/Test/X02zlevi.ztst b/Test/X02zlevi.ztst
index fe55d8a..60f878e 100644
--- a/Test/X02zlevi.ztst
+++ b/Test/X02zlevi.ztst
@@ -49,8 +49,8 @@
 >BUFFER: z
 >CURSOR: 1
 
-  comptesteval 'bindkey -a "^R" redo'
-  zletest $'123\C-_\e\C-r'
+  comptesteval 'bindkey -a "^K" redo'
+  zletest $'123\C-_\e\C-k'
 0:undo in insert mode, redo in command
 >BUFFER: 123
 >CURSOR: 2
diff --git a/Test/comptest b/Test/comptest
index 42fe651..48b6cdf 100644
--- a/Test/comptest
+++ b/Test/comptest
@@ -106,7 +106,7 @@ comptesteval () {
   local tmp=/tmp/comptest.$$
 
   print -lr - "$@" > $tmp
-  zpty_flush Before comptesteval
+  # zpty_flush Before comptesteval
   zpty -w zsh ". $tmp"
   zpty -r -m zsh log_eval "*<PROMPT>*" || {
     print "prompt hasn't appeared."
@@ -118,13 +118,11 @@ comptesteval () {
 
 comptest () {
   input="$*"
-  zpty_flush Before comptest
   zpty -n -w zsh "$input"$'\C-Z'
   zpty -r -m zsh log "*<WIDGET><finish>*<PROMPT>*" || {
     print "failed to invoke finish widget."
     return 1
   }
-  zpty_flush After comptest
 
   logs=(${(s:<WIDGET>:)log})
   shift logs
@@ -154,12 +152,12 @@ comptest () {
 
 zletest () {
   input="$*"
-  zpty_flush Before zletest
+  # zpty_flush Before zletest
   zpty -n -w zsh "$input"$'\C-X'
   zpty -r -m zsh log "*<WIDGET><finish>*<PROMPT>*" || {
     print "failed to invoke finish widget."
     return 1
   }
-  zpty_flush After zletest
+  # zpty_flush After zletest
   print -lr "${(@)${(ps:\r\n:)log##*<WIDGET><finish>}[1,-2]}"
 }



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