zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: Confirming X02zlevi test failures
Date: Wed, 26 Nov 2014 02:13:08 +0900	[thread overview]
Message-ID: <E7064DEC-9EF9-43DB-9B9B-3C9CDD7A93A9@kba.biglobe.ne.jp> (raw)
In-Reply-To: <141120091803.ZM3693@torch.brasslantern.com>


2014/11/21 02:18, Bart Schaefer <schaefer@brasslantern.com> 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;
 }




  parent reply	other threads:[~2014-11-25 17:13 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-19 16:50 Bart Schaefer
2014-11-19 17:25 ` Ray Andrews
2014-11-19 23:05 ` Oliver Kiddle
2014-11-20  6:20   ` Bart Schaefer
2014-11-20 15:42     ` Jun T.
2014-11-20 17:18       ` Bart Schaefer
2014-11-21 14:37         ` Oliver Kiddle
2014-11-21 18:18         ` Jun T.
2014-11-21 18:56           ` Bart Schaefer
2014-11-23  1:37             ` Jun T.
2014-11-23  3:32               ` Bart Schaefer
2014-11-23  7:44                 ` Jun T.
2014-11-24  0:11                   ` Bart Schaefer
2014-11-23  9:00               ` Oliver Kiddle
2014-11-23 18:37                 ` Bart Schaefer
2014-11-25 17:13         ` Jun T. [this message]
2014-11-25 17:32           ` Jun T.
2014-11-25 19:01             ` Bart Schaefer
2014-11-26  2:31               ` Jun T.
2014-11-26 14:51                 ` Oliver Kiddle
2014-11-26 15:45                   ` Peter Stephenson
2014-11-26 16:37                     ` Bart Schaefer
2014-11-27 14:11                       ` Oliver Kiddle
2014-12-01 10:58                         ` Jun T.
2014-12-05 14:36                           ` Oliver Kiddle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E7064DEC-9EF9-43DB-9B9B-3C9CDD7A93A9@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).