From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29365 invoked by alias); 15 Feb 2014 21:35:10 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32389 Received: (qmail 9778 invoked from network); 15 Feb 2014 21:34:54 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <140215133501.ZM1663@torch.brasslantern.com> Date: Sat, 15 Feb 2014 13:35:01 -0800 In-reply-to: <92A29561-15C5-4282-9CDA-7EDBD4030AE6@kba.biglobe.ne.jp> Comments: In reply to "Jun T." "Re: Commit 137b15a fails X02zlevi test" (Feb 16, 2:07am) References: <140208121311.ZM14905@torch.brasslantern.com> <140208144555.ZM16333@torch.brasslantern.com> <140209105343.ZM24252@torch.brasslantern.com> <17919.1391985011@quattro> <140210233703.ZM11806@torch.brasslantern.com> <140212214922.ZM25943@torch.brasslantern.com> <140213093920.ZM27020@torch.brasslantern.com> <140214174253.ZM10203@torch.brasslantern.com> <92A29561-15C5-4282-9CDA-7EDBD4030AE6@kba.biglobe.ne.jp> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Commit 137b15a fails X02zlevi test MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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 "**" || { 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 "***" || { print "failed to invoke finish widget." return 1 } - zpty_flush After comptest logs=(${(s::)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 "***" || { print "failed to invoke finish widget." return 1 } - zpty_flush After zletest + # zpty_flush After zletest print -lr "${(@)${(ps:\r\n:)log##*}[1,-2]}" }