xtermjs/xterm.js

Support RTL languages

Open

#701 aberto em 13 de jun. de 2017

Ver no GitHub
 (47 comments) (56 reactions) (0 assignees)TypeScript (1.574 forks)batch import
area/addon/webglarea/i18narea/renderer-domhelp wantedtype/enhancement

Métricas do repositório

Stars
 (16.196 stars)
Métricas de merge de PR
 (Mesclagem média 2d 10h) (16 fundiu PRs em 30d)

Description

Downstream issue: https://github.com/Microsoft/vscode/issues/28571

When we enforced unicode character width in https://github.com/sourcelair/xterm.js/issues/467 this broke RTL language characters as they are now rendered in reverse (LTR). We could revert that for RTL character ranges only but we should do the right fix and reverse the strings so they're actually on the character grid as the new selection model relies on all characters lining up perfectly on the grid https://github.com/sourcelair/xterm.js/pull/670

Ideally line reflow https://github.com/sourcelair/xterm.js/issues/622 would be done before this so it's easier to change the contents of multiple lines.

Terminal.app:

image

VS Code 1.13 (notice sentences are reversed):

image

@mostafa69d @CherryDT a little info on the languages in question would be handy:

  1. Where should the strings be flipped.for Hebrew/Arabic/Persian, do I reverse entire continuous sequences of characters in-between ascii characters?
  2. How are the characters meant to interact with characters like 0-9 or punctuation?

Useful references:

Guia do colaborador