From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1293 invoked by alias); 10 Sep 2015 16:07:14 -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: 36475 Received: (qmail 21466 invoked from network); 10 Sep 2015 16:07:11 -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-AuditID: cbfec7f5-f794b6d000001495-80-55f1aaacd726 Date: Thu, 10 Sep 2015 17:07:05 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Pasting UTF-8 characters with bracketed-paste-magic seems broken in 5.1 Message-id: <20150910170705.0fbeb302@pwslap01u.europe.root.pri> In-reply-to: <150910084516.ZM22892@torch.brasslantern.com> References: <20150906155751.GD3721@sym.noone.org> <150910073920.ZM21998@torch.brasslantern.com> <20150910145714.GO3721@sym.noone.org> <150910084516.ZM22892@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsVy+t/xK7prVn0MNbj0it/iYPNDJgdGj1UH PzAFMEZx2aSk5mSWpRbp2yVwZdz9fYS14CNXxa+1nYwNjFc5uhg5OSQETCQ2rp3HBGGLSVy4 t56ti5GLQ0hgKaPE362zmUESQgIzmCRetIhDJLYxShy695AdJMEioCqx5/p2sCI2AUOJqZtm M4LYIgLiEmfXnmcBsYUFwiQutk8Ei/MK2Eu8urIYzOYUsJLY8+ofC8TQnYwSn46tYQVJ8Avo S1z9+wnqJHuJmVfOQDULSvyYfA9sKLOAusSkeYuYIWxtiSfvLrBCXKoucePubvYJjEKzkLTM QtIyC0nLAkbmVYyiqaXJBcVJ6blGesWJucWleel6yfm5mxghYft1B+PSY1aHGAU4GJV4eBMu fggVYk0sK67MPcQowcGsJMJr3vcxVIg3JbGyKrUoP76oNCe1+BCjNAeLkjjvzF3vQ4QE0hNL UrNTUwtSi2CyTBycUg2Mk0U2nbd+17BB/8flTYaulXbbwkMUOufax0zcyGeS3xNa4zbzeHPr NNfJ4hVHbGef2nj/sIDE7WvJG/gV+R2eSuWqPai46i4qWZWjl7fmup3B4hXPOLQOVlhVstUL HT1dZX9S/L3snrWOKZxx/DufRj/rVjR+uoJLPmJdeuyRBS/eCS0Su6qoxFKckWioxVxUnAgA s+G9LFcCAAA= On Thu, 10 Sep 2015 08:45:16 -0700 Bart Schaefer wrote: > On Sep 10, 4:57pm, Axel Beckert wrote: > } > } > (1) There is a problem handling multibyte characters in the built-in > } > read-commmand widget; or > } >=20 > } > (2) There is a problem with using ${PASTED#$KEYS} to remove multi-byte > } > characters from the beginning of the pasted text. > }=20 > } (2) looks fine on a first glance: > }=20 > } PASTED=3D=C3=A4o=C3=B6 > } KEYS=3D=C3=A4o > } echo ${PASTED#$KEYS} > } =C3=B6 >=20 > Yes, but KEYS is a ZLE local so its content may be escaped or something. read-command doesn't explicitly handle multibyte characters in the way self-insert does. self-insert gets the remainder of the character. That doesn't work for you because you want KEYS to be correct before the self-insert. KEYS refers to the level where you originally read the keys, in getkeybuf() / getkeymapcmd(), and at this point you've only got the initial byte. So I'm not sure what the fix is. I think it might be (despite what the comment in getkeymapcmd() currently says) to move the special stuff down to the end of getkeymapcmd() and posprocess it into keybuf, which isn't very nice but, well. I'll look later on. Can't really see a good reason for not producing a bug fix version anyway, though, since there's plenty of stuff needs fixing. pws