X-Recipient: archive-cygwin AT delorie DOT com 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 MIME-Version: 1.0 In-Reply-To: <20110225110530.GX9392@calimero.vinschen.de> References: <35i9m6pt07r66fib882etg5tgirkr413co AT 4ax DOT com> <0105D5C1E0353146B1B222348B0411A209DAA0FF98 AT NIHMLBX02 DOT nih DOT gov> <20110224085617 DOT GM9392 AT calimero DOT vinschen DOT de> <4D6762B5 DOT 3000204 AT towo DOT net> <20110225110530 DOT GX9392 AT calimero DOT vinschen DOT de> Date: Sat, 26 Feb 2011 09:52:13 +0000 Message-ID: Subject: Re: wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin] From: Andy Koppe To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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