From: Nicolas Pitre Date: Wed, 7 May 2025 14:13:17 +0000 (-0400) Subject: vt: make sure displayed double-width characters are remembered as such X-Git-Tag: v6.16-rc1~29^2~10 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=68e7a421ab4f0ca97dcfff638bc5c784bf28eebd;p=linux-block.git vt: make sure displayed double-width characters are remembered as such And to do so we ensure the Unicode screen buffer is initialized when double-width characters are encountered. Signed-off-by: Nicolas Pitre Link: https://lore.kernel.org/r/20250507141535.40655-3-nico@fluxnic.net Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 24c6cd2eed78..58fa1b285f22 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -2930,8 +2930,15 @@ static int vc_process_ucs(struct vc_data *vc, int *c, int *tc) { u32 prev_c, curr_c = *c; - if (ucs_is_double_width(curr_c)) + if (ucs_is_double_width(curr_c)) { + /* + * The Unicode screen memory is allocated only when + * required. This is one such case as we need to remember + * which displayed characters are double-width. + */ + vc_uniscr_check(vc); return 2; + } if (!ucs_is_zero_width(curr_c)) return 1;