aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md4
-rw-r--r--terminal.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8a090062..7cc5e13f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -112,11 +112,15 @@
enabled ([#1947][1947]).
* Reflow of the cursor (active + saved) when at the end of the line
with a pending wrap (LCF set) ([#1954][1954]).
+* Zero-width characters that also are grapheme breaks (e.g. U+200B,
+ ZERO WIDTH SPACE) being ignored (discarded and never stored in the
+ grid) ([#1960][1960]).
[1918]: https://codeberg.org/dnkl/foot/issues/1918
[1929]: https://codeberg.org/dnkl/foot/issues/1929
[1947]: https://codeberg.org/dnkl/foot/issues/1947
[1954]: https://codeberg.org/dnkl/foot/issues/1954
+[1960]: https://codeberg.org/dnkl/foot/issues/1960
### Security
diff --git a/terminal.c b/terminal.c
index c8e49663..2e868793 100644
--- a/terminal.c
+++ b/terminal.c
@@ -4153,7 +4153,7 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc)
if (grapheme_clustering) {
/* Check if we're on a grapheme cluster break */
if (utf8proc_grapheme_break_stateful(
- last, wc, &term->vt.grapheme_state))
+ last, wc, &term->vt.grapheme_state) && width > 0)
{
term_reset_grapheme_state(term);
goto out;