diff --git a/docs/changelog.rst b/docs/changelog.rst index 77d0badd7..5572d17ac 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -106,6 +106,11 @@ consumption to do the same tasks. Detailed list of changes ------------------------------------- +0.42.1 [future] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- Fix ambiguous width and private use characters not being rendered when used with variable width text-sizing protocol escape codes + 0.42.0 [2025-05-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kitty/screen.c b/kitty/screen.c index 7891c8a70..a677a93dd 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -1323,8 +1323,10 @@ screen_handle_multicell_command(Screen *self, const MultiCellCommand *cmd, const if ((s = grapheme_segmentation_step(s, cp)).add_to_current_cell || (wcwidth_std(cp) == 0 && lc.count)) lc.chars[lc.count++] = ch; else { if (lc.count) handle_variable_width_multicell_command(self, mcd, &lc); - if (wcwidth_std(cp) < 1) lc.count = 0; - else { lc.chars[0] = ch; lc.count = 1; } + switch(wcwidth_std(cp)) { + case 0: case -1: lc.count = 0; break; + default: lc.chars[0] = ch; lc.count = 1; break; + } } } if (lc.count) handle_variable_width_multicell_command(self, mcd, &lc); diff --git a/kitty_tests/multicell.py b/kitty_tests/multicell.py index 42ee5d85c..9908faed5 100644 --- a/kitty_tests/multicell.py +++ b/kitty_tests/multicell.py @@ -135,6 +135,9 @@ def test_multicell(self: TestMulticell) -> None: for x in range(1, 3): comb(x, y) comb(0, 1) + s.reset() + multicell(s, 'aüa', scale=2) + self.ae(s.cursor.x, 6) s = self.create_screen(cols=7 * 7, lines=7) multicell(s, 'a', scale=7, width=7) for y in range(s.lines):