xtermjs / xtermjs/xterm.js

Support RTL languages

Open
#701 48 comments 58 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/addon/webgl area/i18n area/renderer-dom help wanted type/enhancement
Dominant language
TypeScript
Stars
21.2k
Forks
2k
Avg merge
1d 3h
Merged PRs (30d)
3

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:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Unicode and RTL references, then review the character-width change in issue 467 and the selection model in pull request 670. Check the dependency on line reflow in issue 622 and clarify the behavior around Hebrew, Arabic, Persian, digits, punctuation, and ASCII boundaries. Done means RTL text renders in the correct direction while characters remain aligned on the terminal grid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, internationalization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.