Persian/RTL text renders reversed inside boxed TUI components (e.g. /agents)
Bug description
Persian (Farsi) text — a right-to-left (RTL) script — renders with reversed character order inside bordered/boxed TUI components such as /agents, /help, and other Ink-rendered panels that pad or wrap text to a fixed column width.
Plain conversational text (outside boxed components) renders correctly. The issue only appears where the terminal UI computes visual padding/wrapping, which apparently assumes left-to-right character order and breaks Unicode bidi text.
Steps to reproduce
- Run
claudein a terminal (also reproduced inside the VS Code integrated terminal / VS Code extension panel). - Run
/agents. - Observe that Persian text in the agent list box is displayed with reversed character order (mirrored), while identical Persian text typed in the normal chat area displays correctly.
Expected behavior
Persian/Arabic/Hebrew (RTL) text should render in correct logical/visual order inside boxed or column-padded TUI elements, same as it does in plain chat text.
Actual behavior
RTL text is visually reversed inside boxed/padded components.
Environment
- Claude Code version: 2.1.207
- OS: Windows 10 Enterprise 10.0.19045
- Terminal: VS Code integrated terminal / VS Code extension panel
- Locale/script tested: Persian (Farsi)
Suspected cause
Likely in the Ink-based terminal renderer's text width/padding calculation, which does not account for Unicode bidi algorithm (UAX #9) when truncating/padding RTL strings to fit box/column width.