From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21008 invoked by alias); 12 Sep 2015 18:02:20 -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: 36515 Received: (qmail 6947 invoked from network); 12 Sep 2015 18:02:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=0QzIVqF3Q3c7INI2/JnKIRsgZgxiYj+WgIKxGhCjZQI=; b=G7MNO4RCZze/51FNNWVpS1LRLiSC8JTMuOYq2Xs5ZhQDDit02R3mTRTVc2WFO1Izyy DVf2gyrOP7yvzDu1H9ELdk5Kd0/fKs3OBHnURg/GlyNUokdq2Q506stg8Zr0vfNH300R V8CwEHIe36XH3oMMNHMe0cLrSKPJTCO7HWJxUaPBk5gK/chDYlzgtRDzaCJrwEEDJjlh IqdFqKb/w9lwxMZVr1ij+/ejR6QTNQu5XGq7OZxSS1hFLTRGuxYGNKxdEbjmSe91Hz/f IaxJCnrDjkZe1QLW/JnPytAuk1hXX1Ie9DFquz42FTEoF/opsVphu4TO7G7N+eWV0Zh0 ru0A== X-Gm-Message-State: ALoCoQnAbjTsiLtRf+HuTm76BbQT40Vx6HFr9pDk8A6pyN7k5AolZ27WN3ud0yrkUmGvO/0zQU/D X-Received: by 10.182.29.73 with SMTP id i9mr4106525obh.59.1442080937552; Sat, 12 Sep 2015 11:02:17 -0700 (PDT) From: Bart Schaefer Message-Id: <150912110214.ZM11964@torch.brasslantern.com> Date: Sat, 12 Sep 2015 11:02:14 -0700 In-Reply-To: Comments: In reply to Bart Schaefer "Re: PATCH: read full multibyte string a bit more sooner" (Sep 12, 9:46am) References: <150911154207.ZM8630@torch.brasslantern.com> <375b5c20-868c-41f6-af3d-297026ddbda5@email.android.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: PATCH: read full multibyte string a bit more sooner MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 9:46am, Bart Schaefer wrote: } } I then switched back to zsh-5.1.1-dev-0 and tried to repeat this. } } The very first time I pasted the test string, I got this: [...] } } As you can see this is ALMOST correct, except for that unexpected } trailing tilde So one more tidbit: I reverted back to the 5.1 version of the bracketed-paste-magic source with the 5.1.1-dev-0 binary and tried this again, and with the mbchar+= loop removed (so relying solely on read-command to read multiple bytes properly), I NEVER get a correct result, even on first paste -- I always get the garbage. Which means that read-command is still returning something that matches [[:INCOMPLETE:]]* on that very first call, which ought to be impossible as I understand it. And indeed, if I step across getrestchar() with a debugger, it's failing on any character that is more than two bytes wide (returning only the first two bytes), which probably leaves mbrtowc() in an indeterminate state. (This is reading from the "zle -U" buffer so key timeout does not matter.) Is it possible this is happening because my environment LC_CTYPE is not set, even though I have LANG=en_US.UTF-8 ?