From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23075 invoked by alias); 21 Oct 2016 01:09:46 -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: 39695 Received: (qmail 8923 invoked from network); 21 Oct 2016 01:09:46 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f181.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.181):SA:0(0.0/5.0):. Processed in 0.353181 secs); 21 Oct 2016 01:09:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: gopsychonauts@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.192.181 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=yR4en5y1hRx+NDZ/8XeNHzW9d7eKdSUSWbfn+7SpHrw=; b=VDc5UojEAQoHYUyd0omNmcVFX/FLruUAWYT5/xXhL5g99qdAhZpwhQhgp7iBggJ2Jh IbVfyFFcaP0VbmtpjGOTnVyDCD6xOjAX25IaFV3z0xnvkezuxw5TcCR+zWVdmR2OdvOS qr/h79/3YqTLv0skYGgEsKQFGgh/rnBy/ZuOGTIYnxTOcdiOsxluiQaCH01isngpHc+6 dwWJZSMMRozMWkPDahcKiE+1nkxZL7TAWKudcLvLgaJKlObVmkNt93EF3ehJOIAkQUX7 8fpkMnGrjOwhnE1uSzq7VXH+e+qAMXikV99TmyQjE0jVLLcHDS7OUNJVQ8v3bz/xUqzP w2qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=yR4en5y1hRx+NDZ/8XeNHzW9d7eKdSUSWbfn+7SpHrw=; b=nMmU2fa5brK0fWz9xwAtmaxP0oG21aO0S5LcFbu7LCN8v2V3gaij41fpqMl7Ib5GDb oIa/n7RY2ts77dyRt7SnTyLTgHlIgkCLoMl9oE87nbpm30YTrQF4SyNL/A81sMUEK4IJ JurRWSpl7sBAIgSSnUWYGwc4NawQQYNNZtn13trnxJ/A9uyx6QhBKMgC5FD7Dwt1NJ9G 4aYc48JwJTBriFOAgH+Zp3K02M26lKB+gyEZ95V3iPEv5cdrt04dkmuzuzrFABFvXZYP 9mtHK3y5FPrTiVLLrnWV3zNQguWgfRE75/3G5hn+EL3y20l9Xjt8O9XuX1wqfAbXTKoK Yx3g== X-Gm-Message-State: AA6/9RmJj1auIH5tHAlgKFfcernTW2K4FTd/DxHzKMS31VmvOjBlsxdEqIJkiVVqzV1Ydw== X-Received: by 10.98.147.218 with SMTP id r87mr6427793pfk.108.1477012180391; Thu, 20 Oct 2016 18:09:40 -0700 (PDT) Date: Fri, 21 Oct 2016 12:09:34 +1100 From: Danielle McLean To: zsh-workers@zsh.org Cc: danielsh@apache.org Subject: zsh/complist colours improperly handle multibyte characters Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20161014 (1.7.1) Although zsh patterns usually have full support for multibyte characters, a zsh pattern containing certain multibyte characters will fail to match if provided to zsh/complist using $ZLS_COLORS or the list-colors zstyle. For example, the following zstyles will fail to match and colour anything:     zstyle :completion:*:options list-separator │     zstyle :completion:*:options =*│*=32     ls -l This is not the case for *all* multibyte characters. For example, the following zstyles successfully colour the entire option green:     zstyle :completion:*:options list-separator ©     zstyle :completion:*:options =*©*=32     ls -l Additionally, when applying multiple colours with a (#b) pattern, multibyte characters break the colouring even if matched with a wildcard like * rather than a literal. In this example, the options are blue and their descriptions green - except for the last two characters of the description which are not coloured:     zstyle :completion:*:options list-separator │     zstyle :completion:*:options "=(#b)([^ ]#)(*)=0=34=32"     ls -l This issue also occurs if © is used as the separator: the complist will colour all but the last character of the description, in that case. I believe the reason behind this behaviour is that in UTF-8, © is a two-byte character and │ is a three-byte character. Presumably, zsh/complist's pattern parsing is only aware of one- and two-byte chars, and its (#b)-based grouping mistakenly assumes that all characters are single bytes.