On Tue, Apr 12, 2016 at 11:37 PM, Jochen Sprickerhof <d...@jochen.sprickerhof.de> wrote: > * Marc Collin <marc.coll...@gmail.com> [2016-04-12 16:31]: >> So this is not a st bug and not a libc bug. > > I think it's a libc bug as well, quoting man 3 wcwidth: > > "The wcwidth() function returns the number of columns needed to > represent the wide character c. If c is a printable wide character, the > value is at least 0. If c is null wide character (L'\0'), the value is > 0. Otherwise, -1 is returned." > > So wcwidth('a') == 1, but wcwidth('☺') == -1 (but I would assume the > emoji is printable ;) ).
Have you tested it exactly as you wrote it here? Since wcwidth wants a wchar_t you probably would have to use L'☺'. Cheers, Silvan