Skip to content

[Feature]: Native RTL support for Arabic and mixed RTL/LTR text in Hermes Chat #44150

@SaudNull

Description

@SaudNull

Problem or Use Case

I'm trying to use Hermes Desktop Chat in Arabic, but Hermes currently does not handle right-to-left text well in the Chat experience.

The issue is not limited to the composer/input field. It also affects assistant responses rendered in the chat/terminal area.

This becomes especially confusing when the text mixes Arabic and English, which is the normal case for technical conversations. For example, Hermes responses often contain Arabic explanations mixed with English terms, commands, filenames, code symbols, model names, flags, and paths. Without proper bidirectional text handling, the order and visual flow become hard to follow.

If a message is fully Arabic, the issue is sometimes less confusing, but the text still feels visually scattered and uncomfortable to read. Mixed Arabic/English responses are much worse and can become genuinely confusing.

This makes Hermes difficult to use for Arabic-speaking users, especially in coding workflows where mixed Arabic and English is expected.

Proposed Solution

Add native RTL / bidirectional text support to Hermes Chat, covering both:

  • User input / composer text
  • Assistant responses and rendered chat messages

Suggested behavior:

  • Detect paragraph direction from the first strong character.
  • Render Arabic/Hebrew/Persian/Urdu paragraphs as RTL.
  • Keep English-only paragraphs LTR.
  • Preserve code blocks, commands, file paths, diffs, stack traces, and terminal output as LTR.
  • Handle mixed Arabic/English text using proper Unicode bidirectional behavior, such as dir="auto" and unicode-bidi: plaintext where applicable.
  • Scope this only to the Chat experience, not the entire dashboard.
  • Do not force the whole app UI to RTL.

Possible config option:

dashboard:
  chat_text_direction: auto # auto | ltr | rtl

### Alternatives Considered


**Alternatives Considered**
```markdown
- Patching Hermes Desktop locally by injecting CSS/JS into the built dashboard assets.
  - This is fragile and caused Hermes Desktop to open as a blank white window after restart.
- Forcing the whole app or OS writing direction to RTL.
  - This affects navigation, settings, logs, terminal UI, and other areas that should remain LTR.
- Only fixing the composer/input field.
  - This would not solve the main reading problem, because assistant responses are also confusing when Arabic and English are mixed.
- Leaving everything LTR.
  - This makes Arabic and mixed Arabic/English conversations hard to read and easy to misinterpret.

### Feature Type

Other

### Scope

Medium (few files, < 300 lines)

### Contribution

- [x] I'd like to implement this myself and submit a PR

### Debug Report (optional)

```shell

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliverytype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions