From 10c680551e899805a6de7360e9b65986fd87df72 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 27 Jan 2022 20:35:22 +0200 Subject: [PATCH] Improve detection of glyphless characters on TTY frames * src/term.c (produce_glyphs): If the terminal can report for which characters it has glyphs, use that to determine whether a given character should be displayed as glyphless. --- src/term.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/term.c b/src/term.c index 4c7a90a5773..ddf0e8e2f28 100644 --- a/src/term.c +++ b/src/term.c @@ -1632,9 +1632,13 @@ produce_glyphs (struct it *it) } else { - Lisp_Object charset_list = FRAME_TERMINAL (it->f)->charset_list; + struct terminal *t = FRAME_TERMINAL (it->f); + Lisp_Object charset_list = t->charset_list, char_glyph; - if (char_charset (it->char_to_display, charset_list, NULL)) + if (char_charset (it->char_to_display, charset_list, NULL) + && (char_glyph = terminal_glyph_code (t, it->char_to_display), + NILP (char_glyph) + || (FIXNUMP (char_glyph) && XFIXNUM (char_glyph) >= 0))) { it->pixel_width = CHARACTER_WIDTH (it->char_to_display); it->nglyphs = it->pixel_width; -- 2.39.5