wcwidth and terminals [Re: Mg3a - a version of Mg2a developed on Cygwin]

Andy Koppe andy.koppe@gmail.com
Sat Feb 26 09:52:00 GMT 2011


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.  How's the OS version
> 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.  How's the function
> 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



More information about the Cygwin mailing list