Re: [dev] [st] Rendering only half of emoji in curses-based program

From: Andrej Nabergoj <andrej.nabergoj_AT_siol.net>
Date: Mon, 31 Mar 2025 20:02:40 +0200

wcwidth(L"😍") gives me 2 if you meant this. I tried on another laptop
(but it has debian installed too) and problem was the same.
If I print any character that has wcwidth() = 2 to the third last place
of terminal, only half of the character is rendered. This only happens
if using curses. I'v tried it on debian and on another fedora laptop.
```
#include <curses.h>
#include <locale.h>

int main() {
    int last_row = 5, last_column = 25;
    setlocale(LC_ALL, "");
    initscr();
    mvaddstr(last_row, last_column-2, "字");
    getch();
    endwin();
    return 0;
}
```
Thank you for trying to reproduce it.

Andrej

On 30/03/25 05:33, Eric Pruitt wrote:
> On Sun, Mar 30, 2025 at 07:32:14PM +0200, Andrej Nabergoj wrote:
> > The program is so small I don't need github, I apologise.
> > If you make st window 1 row high and 9 columns wide, so string
> > "😍😍😍😍x" should fill whole window, last emoji gets cut on half.
>
> I can't reproduce this. What does wcwidth(3) return for the emoji?
>
> Eric
>
> PS: Sender BCC'd because I have delivery issues with the suckless
> mailing lists.
Received on Mon Mar 31 2025 - 20:02:40 CEST

This archive was generated by hypermail 2.3.0 : Mon Mar 31 2025 - 20:12:09 CEST