microsoft / microsoft/vscode

Bug: Broken BiDi text rendering and layout flipping in Copilot Chat Webview (RTL/LTR mixed text)

Open
#326,008 0 comments 0 reactions 1 assignee Claimed by @justschen View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Description
When using GitHub Copilot Chat in VS Code with Persian (Right-to-Left) dominant text mixed with inline English tokens, the layout engine fractures the word order and wraps trailing punctuation to the opposite side of the line.

I originally reported this in the GitHub Community Discussions, where it was highly recommended to file an official issue directly in this repository for the engineering team.

### Live Replication & Discussion
- **Original Discussion:** (

[bidi_test.html](https://github.com/user-attachments/files/30057751/bidi_test.html)

https://github.com/orgs/community/discussions/201243#discussioncomment-17570129)
- **Replication Details:** The underlying chat webview container evaluates text using default LTR alignment. It fails to isolate text direction boundaries for RTL users.

### Proposed Fix
Applying the following CSS to the chat message container elements (e.g., `.chat-message-content`) solves the wrapping and inversion issue flawlessly:
```css
direction: auto;
unicode-bidi: plaintext;

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.