Implementation:0xranx OpenContext TerminalSidebar
| Knowledge Sources | |
|---|---|
| Domains | Terminal, React |
| Last Updated | 2026-10-24 00:00 GMT |
Overview
Embedded xterm.js terminal sidebar for the desktop app, supporting multiple terminal sessions with CLI presets, theme-aware colors, and PTY management via Tauri commands.
Description
The TerminalSidebar.jsx component in src/ui/src/components/ integrates xterm.js with the Tauri PTY backend. It supports multiple terminal tabs, CLI presets (Codex, Claude Code, OpenCode, Custom), theme-aware terminal colors (light/dark), fit-to-container resizing via FitAddon, and session lifecycle (spawn, write, resize, kill). It listens to terminal-output and terminal-exit Tauri events for streaming output and process exit codes.
Usage
Import this component in App.jsx to render the terminal sidebar panel.
Code Reference
Source Location
- Repository: 0xranx_OpenContext
- File: src/ui/src/components/TerminalSidebar.jsx
- Lines: 1-639
Signature
export default function TerminalSidebar({ isVisible, onClose })
Import
import TerminalSidebar from './components/TerminalSidebar';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| isVisible | boolean | Yes | Panel visibility |
| onClose | Function | Yes | Close panel callback |
Usage Examples
Rendering Terminal Sidebar
import TerminalSidebar from './components/TerminalSidebar';
<TerminalSidebar
isVisible={showTerminal}
onClose={() => setShowTerminal(false)}
/>