From 6c70cd9366db76f10d822252151a782f638d1f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 30 May 2021 19:36:59 +0200 Subject: [PATCH] =?UTF-8?q?vt:=20don=E2=80=99t=20force=20cols=3D2=20when?= =?UTF-8?q?=20we=20see=20an=20emoji=20variant=20selector?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fish appears to be the only shell expecting this. The rest probably just does wcswidth(), like usual. --- vt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vt.c b/vt.c index 6ad539d7..aff3131b 100644 --- a/vt.c +++ b/vt.c @@ -733,10 +733,12 @@ action_utf8_print(struct terminal *term, wchar_t wc) if (term->composed_count < CELL_COMB_CHARS_HI) { /* TODO: grapheme cluster width */ int grapheme_width = wcswidth(new_cc.chars, new_cc.count); +#if 0 /* Fish expects this, but nothing else */ if (new_cc.chars[new_cc.count - 1] == 0xfe0f) { /* Emoji selector */ - grapheme_width = 2; + grapheme_width = max(2, grapheme_width); } +#endif new_cc.width = grapheme_width; term->composed_count++;