How shark-empire/mitos-terminal works
MITOS Terminal is a native terminal emulator: user input and PTY output meet in a per-pane session, VT output updates a screen model, and the app renders it in a tabbed/split GUI. Major documented capabilities include search and selection, themes and effects, configuration hot reload, accessibility, shell hooks, and MITOS integrations. Sampled source confirms session/parser/render ownership and app-to-session actions; README describes other subsystems whose detailed wiring was not sampled, so uncertain links are omitted.
Main entry points: app.rs Application controller · session.rs PTY session · mod.rs VT screen model · render.rs Grid painter
Components 22
Terminal runtime
- PTY session
src/session.rs - PTY and shell
src/pty.rs - VT screen model
src/term/mod.rs - Escape interpreter
src/term/perform.rs - Screen operations
src/term/ops.rs - Scrollback search
src/term/search.rs - Input encoding
src/input.rs - Terminal policy
src/security.rs
Window interface
- Application controller
src/app.rs - Tabs and splits
src/layout.rs - Settings and profiles
src/config.rs - Desktop services
src/platform.rs
Appearance and access
- Grid painter
src/render.rs - Theme engine
src/theme.rs - Visual effects
src/fx.rs - Accessibility
src/a11y.rs
MITOS integration
- Ecosystem IPC
src/ipc.rs - Package bridge
src/pkg_bridge.rs - Shell integration hooks
shell-integration
Other components
- Terminal user
- Child shell
- MITOS services
Connections 27
- Terminal user → Application controller: operates
- Application controller → Tabs and splits: manages panes
- Application controller → PTY session: spawns and resizes
- Application controller → Input encoding: encodes input
- Application controller → VT screen model: reads screen
- Application controller → Grid painter: paints panes
- Application controller → Settings and profiles: loads settings
- PTY session → PTY and shell: spawns child
- PTY and shell → Child shell: runs
- PTY session → VT screen model: feeds PTY bytes
- VT screen model → Escape interpreter: interprets sequences
- Escape interpreter → Screen operations: updates screen
- Input encoding → PTY session: writes child bytes
- PTY session → Child shell: transfers input and output
- Application controller → Scrollback search: queries scrollback
- Application controller → Terminal policy: applies policy
- VT screen model → Terminal policy: emits policy events
- Grid painter → VT screen model: reads screen state
- Grid painter → Theme engine: resolves colors
- Application controller → Visual effects: paints effects
- Application controller → Accessibility: provides accessibility
- Application controller → Desktop services: uses desktop services
- Application controller → Ecosystem IPC: serves ecosystem requests
- Ecosystem IPC → MITOS services: communicates
- Application controller → Package bridge: handles missing commands
- Package bridge → MITOS services: requests installs
- Application controller → Shell integration hooks: installs shell hooks