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

Re: Confirming X02zlevi test failures



2014/11/21 02:18, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:

> Clearly the slave can "see" it's own
> output if the master doesn't manage to grab it first.

I also added some dputs() to zle_main.c as in the patch below, but
I could not reproduce your observation; it seems (at least on my
Mac) the slave zsh sees only what the master has written.
But the test fails nonetheless.

Typical dputs() output during testing 'swap case on a blank line' is
like the following (on Mac, select() is used in place of poll()):

 T 1 1 1 0
 S 0 10000     select() timeouts
 T 0 0 0 0
 R <^[>

 T 1 1 1 0
 S 1 10000      does NOT timeout
 R <~>

 T 0 0 0 1      delayzsetterm=1
 R <a>

 T 0 0 0 1
 R <I>

 T 0 0 0 1
 R <^[>

 T 1 1 1 1
 R <~>          select() not called since delayzsetterm=1

For the 1st tilde, select() is called with the correct timeout, but it
returns 1 (i.e., 1 descriptor is ready for read) rather than timeouts.
This may be due to that some data has been received by the slave tty
while it is in the canonical mode...?

The reason that delayzsetterm becomes 1 may be that bash_complete-word
calls zrefresh(). I guess this problem will go away if the 1st ESC-tilde
is correctly handeld.
But once delayzsetterm becomes 1, it is not reset to 0 until zsetterm()
is called again.


diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
index d157e36..31b577d 100644
--- a/Src/Zle/zle_main.c
+++ b/Src/Zle/zle_main.c
@@ -531,6 +531,8 @@ raw_getbyte(long do_keytmout, char *cptr)
 #endif
 
     calc_timeout(&tmout, do_keytmout);
+    dputs("T %d %d %d %d", do_keytmout, tmout.tp,
+	    tmout.tp ? tmout.exp100ths : 0, delayzsetterm);
 
     /*
      * Handle timeouts and watched fd's.  If a watched fd or a function
@@ -635,6 +637,7 @@ raw_getbyte(long do_keytmout, char *cptr)
 	    selret = select(fdmax+1, (SELECT_ARG_2_T) & foofd,
 			    NULL, NULL, tvptr);
 	    winch_block();
+	    dputs("S %d %d",selret,tvptr->tv_usec);
 # endif
 	    /*
 	     * Make sure a user interrupt gets passed on straight away.
@@ -853,6 +856,7 @@ raw_getbyte(long do_keytmout, char *cptr)
     winch_unblock();
     ret = read(SHTTY, cptr, 1);
     winch_block();
+    dputs("R <%c>\n",*cptr);
 
     return ret;
 }





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