From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25276 invoked by alias); 26 Feb 2011 09:52:21 -0000 Received: (qmail 25264 invoked by uid 22791); 26 Feb 2011 09:52:21 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_WC,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yi0-f43.google.com (HELO mail-yi0-f43.google.com) (209.85.218.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Feb 2011 09:52:15 +0000 Received: by yia13 with SMTP id 13so1362491yia.2 for ; Sat, 26 Feb 2011 01:52:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.236.110.6 with SMTP id t6mr5890067yhg.49.1298713933638; Sat, 26 Feb 2011 01:52:13 -0800 (PST) Received: by 10.147.99.4 with HTTP; Sat, 26 Feb 2011 01:52:13 -0800 (PST) In-Reply-To: <20110225110530.GX9392@calimero.vinschen.de> References: <35i9m6pt07r66fib882etg5tgirkr413co@4ax.com> <0105D5C1E0353146B1B222348B0411A209DAA0FF98@NIHMLBX02.nih.gov> <20110224085617.GM9392@calimero.vinschen.de> <4D6762B5.3000204@towo.net> <20110225110530.GX9392@calimero.vinschen.de> Date: Sat, 26 Feb 2011 09:52:00 -0000 Message-ID: Subject: Re: wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] From: Andy Koppe To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2011-02/txt/msg00559.txt.bz2 On 25 February 2011 11:05, Corinna Vinschen wrote: > On Feb 25 09:05, Thomas Wolff wrote: >> For cygwin, it might be useful (although not standard) for wcwidth >> to consider whether it's running in a cygwin console or a terminal, >> so e.g. wcwidth (0x8080) should return 2 in mintty but 1 in a cygwin >> console. > > Hmm, I don't think that's the right thing to do. =C2=A0How's the OS versi= on > of wcwidht supposed to know what the wcwidth function is used for? > After all, the application does *not* specify that it calls wcwidth > to get the size of a character for a specifc purpose. =C2=A0How's the fun= ction > to know that the character is supposed to be printed to the current tty? > What if the application has open handles to more than one tty? I agree. Also, I'd be surprised if character width in the console was actually constant across different locales, fonts, and Windows versions. Andy -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple