aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-04-24 06:23:56 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-24 06:23:56 +0000
commit70b324b24c86473a99528feb6f1f91ca70e11a02 (patch)
tree0fe9fff559b8bf2baf0f1366ed09bd6ee63e6cb1
parentAdd alacritty theme (diff)
term: ignore LTR+RTL markers (U+200E + U+200F)
Foot doesn't implement RTL, and explicit LTR markers is neither needed, nor used in anyway. In fact, they cause issues with font lookup, as fcft often fails to find the marker codepoint in the primary font, causing a fallback font to be used instead. Closes #2049
-rw-r--r--CHANGELOG.md9
-rw-r--r--terminal.c8
2 files changed, 17 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 35669f03..62dc7e03 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -63,6 +63,13 @@
## Unreleased
### Added
### Changed
+
+* Left-to-right and right-to-left markers (U+200E and U+200F) are now
+ ignored ([#2049][2049]).
+
+[2049]: https://codeberg.org/dnkl/foot/issues/2049
+
+
### Deprecated
### Removed
### Fixed
@@ -73,6 +80,8 @@
codepoints ([#2039][2039]).
* Keyboard modifiers not being reset on keyboard leave events
([#2034][2034]).
+* Last character in a `remind` calendar event being in the wrong font
+ and color ([#2049][2049]).
[2039]: https://codeberg.org/dnkl/foot/issues/2039
[2034]: https://codeberg.org/dnkl/foot/issues/2034
diff --git a/terminal.c b/terminal.c
index ae1adb1a..59c39760 100644
--- a/terminal.c
+++ b/terminal.c
@@ -4156,6 +4156,14 @@ term_process_and_print_non_ascii(struct terminal *term, char32_t wc)
(grapheme_clustering ||
(!grapheme_clustering && width == 0 && wc >= 0x300)))
{
+ if (unlikely(wc == 0x200e || wc == 0x200f)) {
+ /*
+ * Ignore left-to-right and right-to-left markers
+ * see https://codeberg.org/dnkl/foot/issues/2049
+ */
+ return;
+ }
+
int col = term->grid->cursor.point.col;
if (!term->grid->cursor.lcf)
col--;