#1072627 /usr/bin/qterminal: Wrong order of RTL text when escape sequences present

Package:
qterminal
Source:
qterminal
Description:
Lightweight Qt terminal emulator
Submitter:
Ruud Harmsen
Date:
2024-06-05 11:12:03 UTC
Severity:
normal
#1072627#5
Date:
2024-06-05 10:59:19 UTC
From:
To:
Dear Maintainer,

When there are escape sequences, for example the ones that grep
sends to highlight found text in a different color, the display
order of right-to-left scripts like Hebrew and Arabic is incorrect.

I suspect this is because qterminal first applies Unicode's
bidirectional algorithm, on the text including the escape
sequences, and then interprets the escape sequences. IMHO is
should be the other way round.

Other terminal programs, such as gnome-terminal and konsole, do
this right.

See also my article https://rudhar.com/sfreview/grepcolr.htm . It
has more details, and easily testable examples.