← Back to team overview

desktop-packages team mailing list archive

[Bug 263822] Re: RTL (right to left) support in terminal (BiDi)

 

Usama,

The reason for bug #1537064 is me nagging Yaron. The problem of BiDi
cannot be solved in a terminal vt100 environment. The reason - is that
the application does not  telling the VTE the boundaries of the
paragraph.

Imagine "mc" opeenning a dialog to rename a file. Lets check the
options;

1) A line contains  RTL - apply BiDi to it and display line in RTL. Funny things will happen, as the line bellow will also be reverted. The file name of the right panel - will be on the left. 
2) Even funnier - when you type lam and aliph - those will be displayed as a single glyph on screen and the app counted two unicode chars (4 bytes in UTF8) and now the left margin is off by one (the frames of the dialog are also text, remember - the app needs to pad spaces until the "|" char will be displayed).
3) OK  - instead of reverting a whole line - lets revers each word - this is broken since you now have proper words in LTR order (lets ignore #2)
4) OK - lets detect the word boundary and de-order "n" words - when happens when the first word of the next paragraph starts with an english word? the direction will be broken.

I assume we can find other problems. Lets find solutions:
1) Do the BiDi in apps, while assuming the ternimal is dumb: OK, it will work on xterm, konsole, gnome-terminal, and VT. Problem - we need to fix *ALL* terminal apps.
2) Do the BiDi in terminals - in order to fix all above problems, we need a way to report to the terminal about the regions that will contain text that he may modify. Then code a reference implementation, issue an RFC and port to all other terminals.

TL.DR.  Ternimals are broken by design and cannot support RTL/BIDI. Just
move on and use X11/Wayland for Arabic/Farsi/Hebrew/Whatever and don't
translate those interfaces to the native languages on terminals.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to vte in Ubuntu.
https://bugs.launchpad.net/bugs/263822

Title:
  RTL (right to left) support in terminal (BiDi)

Status in Gnome Virtual Terminal Emulator:
  Confirmed
Status in vte package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: gnome-terminal

  The program fails to display bi-directional text correctly. For example,
   the Arabic  word Went (راح) should be spelled raa (ر) Alif (ا) haa (ح)
   from right to left. The program displays the Arabic text in the opposite direction.

  examples:
  ا ب ج
  become
  ج ب ا

  if the problem with numbers (and it's not) it will look like:
  123
  become
  321

  that makes many translated terminal applications messages unreadable
  like dpkg & apt-get

  ProblemT
  ype: Bug
  Architecture: i386
  Date: Tue Sep  2 04:44:06 2008
  DistroRelease: Ubuntu 8.04
  ExecutablePath: /usr/bin/gnome-terminal
  Package: gnome-terminal 2.22.1-0ubuntu2
  PackageArchitecture: i386
  ProcEnviron:
   PATH=/usr/locusernamel/sbin:/usr/locusernamel/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gusernamemes
   LANG=en_US.UTF-8
   SHELL=/bin/busernamesh
  SourcePackage: gnome-terminal
  Uname: Linux 2.6.24-19-generic i586

To manage notifications about this bug go to:
https://bugs.launchpad.net/vte/+bug/263822/+subscriptions