From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26798 invoked from network); 16 Feb 2008 19:13:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Feb 2008 19:13:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 65921 invoked from network); 16 Feb 2008 19:13:45 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Feb 2008 19:13:45 -0000 Received: (qmail 2736 invoked by alias); 16 Feb 2008 19:13:42 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24560 Received: (qmail 2720 invoked from network); 16 Feb 2008 19:13:41 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 16 Feb 2008 19:13:41 -0000 Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by bifrost.dotsrc.org (Postfix) with ESMTP id E89638026E0B for ; Sat, 16 Feb 2008 20:13:38 +0100 (CET) Received: from torch.brasslantern.com ([71.121.18.67]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0JWC000QNIQPSK90@vms042.mailsrvcs.net> for zsh-workers@sunsite.dk; Sat, 16 Feb 2008 13:13:38 -0600 (CST) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m1GJDakO017126 for ; Sat, 16 Feb 2008 11:13:36 -0800 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m1GJDZdF017125 for zsh-workers@sunsite.dk; Sat, 16 Feb 2008 11:13:35 -0800 Date: Sat, 16 Feb 2008 11:13:35 -0800 From: Bart Schaefer Subject: Re: Fw: Phil's prompt is not working when LANG is set to UTF-8 In-reply-to: <20080215235241.2f255730@pws-pc> To: "Zsh Hackers' List" Message-id: <080216111335.ZM17124@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <20080215235241.2f255730@pws-pc> Comments: In reply to Peter Stephenson "Fw: Phil's prompt is not working when LANG is set to UTF-8" (Feb 15, 11:52pm) X-Virus-Scanned: ClamAV 0.91.2/5837/Sat Feb 16 18:14:09 2008 on bifrost X-Virus-Status: Clean On Feb 15, 11:52pm, Peter Stephenson wrote: } } - Hence it falls foul of the multibyte tests. In principle it } might clash with a UTF-8 character anyway and have the wrong } width, so assuming a width 1 for an unknown character is not } necessarily better than assuming width 0. I agree with "not necessarily," but I suspect it'll be right more often than wrong to assume 1. *Most* characters are not going to be "non-printing," and if the mb library doesn't recognize them, then they're also unlikely to be simultaneously multibyte and handled correctly by the terminal. I'll bet I argued this the other way when this came up the last time, but now we have some empirical results. } How about the following tweak to prompts to support this? The upshot } is that you include any funny characters in %{...%G%} where the %G for } `glitch' (which may be repeated or take a numeric argument) indicates } a screen cell taken up by the sequence. I like this, but I'm wondering if it might not be better to have %{ accept a count, e.g., instead of %{...%6G%} just write %6{...%}. Does it matter where %G appears? %{...%7G...%} ? What if you use it more than once, as in %{...%7G...%3G%} ? Using a count on %{ might make it more obvious that you should write %7{...%}%3{...%} if %7G%3G != %10G.