RTL Lens
RTL Lens is a Visual Studio Code extension for reading Hebrew, Arabic, and mixed RTL/LTR text without changing Copilot, chat extensions, terminals, or other providers.
The extension adds an independent display layer: select text in the active editor and run RTL Lens: Open Selection. The selected text opens in a WebView panel with direction-aware rendering, right-aligned RTL text, LTR code blocks, and font size controls.
Features
- Opens selected editor text in a dedicated WebView panel.
- Adds an RTL Lens Activity Bar view with a magnifying-glass icon.
- Opens copied text from Copilot Chat, Cline, Output, and other protected WebViews through the clipboard.
- Can watch the clipboard after explicit opt-in, so copied chat text opens automatically.
- Attempts to capture selected terminal text through VS Code's terminal copy command.
- Shows a
$(search) RTL Lens status bar action for opening copied text.
- Detects Hebrew-heavy text and defaults the view to RTL.
- Preserves LTR layout for fenced code blocks and likely code lines.
- Supports mixed Hebrew/English content with
unicode-bidi: plaintext.
- Includes font size increase/decrease controls.
- Provides an optional keyboard shortcut:
- Windows/Linux:
Ctrl+Alt+R
- macOS:
Cmd+Alt+R
Commands
| Command |
Command ID |
| RTL Lens: Open Selection |
rtlLens.openSelection |
| RTL Lens: Open Clipboard |
rtlLens.openClipboard |
| RTL Lens: Open Terminal Selection |
rtlLens.openTerminalSelection |
| RTL Lens: Toggle Clipboard Watch |
rtlLens.toggleClipboardWatch |
Using RTL Lens With Chat, Cline, Copilot, Output, And Terminal
VS Code does not allow one extension to read selected text directly from another extension's WebView. That means Copilot Chat, Cline, Claude-style chat panels, and similar surfaces cannot be captured through the editor selection API.
Use Clipboard Watch for the quickest flow:
- Run RTL Lens: Toggle Clipboard Watch once, or press
Ctrl+Alt+Shift+W / Cmd+Alt+Shift+W.
- Select text in Copilot Chat, Cline, Output, Terminal, or any other panel.
- Copy it with
Ctrl+C / Cmd+C.
- RTL Lens opens the copied text automatically.
You can also use the manual clipboard flow:
- Select text in Copilot Chat, Cline, Output, or any other panel.
- Copy it with
Ctrl+C / Cmd+C.
- Run RTL Lens: Open Clipboard from the Command Palette, the RTL Lens Activity Bar view, or the status bar.
For the integrated terminal:
- Select text in the terminal.
- Run RTL Lens: Open Terminal Selection.
- If your terminal shell or platform does not expose the selection to VS Code, copy manually and run RTL Lens: Open Clipboard.
Development
Install dependencies:
npm install
Compile the extension:
npm run compile
Watch TypeScript during development:
npm run watch
Run locally:
- Open this folder in VS Code.
- Press
F5 to launch the Extension Development Host.
- Select mixed Hebrew/English/code text in an editor.
- Run RTL Lens: Open Selection from the Command Palette.
To test with Copilot Chat, Cline, Output, or similar panels, copy text from the panel and run RTL Lens: Open Clipboard.
Package for the VS Code Marketplace:
npm run package
Publish after configuring a Marketplace publisher and token:
npm run publish
Architecture
RTL Lens is intentionally provider-agnostic. The current command reads from the active text editor selection, while the rendering function accepts plain text and can later be reused by commands that receive text from Copilot Chat, Cline, Claude, Terminal, Output, or clipboard-based flows when VS Code exposes or permits those sources.