- In-tai.py TUI framework (panels, compositor, z-layers, mouse, focus, VT screen, pty sub-terminals, widgets, animation) plus /demo, --demo, --demo-shot, tui.md docs, and research/tui-framework-design archive - Focus safety: Tab/Shift+Tab always cycle, auto-focus prefers non-terminals, dialogs restore previous focus on close - Native Consts/Install/Sandbox/Opencode/SysInfo classes in tai.py; module functions delegate so live patches apply; fixes 19 failures - Retargeted 4 test patches to the real tai.* seams (assertions unchanged) - Deleted tai_pkg/; tai.py is standalone stdlib-only (bare copy imports) - AGENTS.md/README.md updated to the standalone architecture - test_tai.py 320/320 OK, test_seal.py 16/16 OK
2.7 KiB
2.7 KiB
selectel/pyte repository (README)
Metadata
| Field | Value |
|---|---|
| Institute | Molodetz Institute — Research & Retrieval Division |
| Subject | tui-framework-design |
| Document type | Source Dossier |
| Tier | 1 |
| Source title | selectel/pyte: Simple VTXXX-compatible linux terminal emulator |
| Source URL | https://github.com/selectel/pyte |
| Source publisher / author | selectel (Sergei Lebedev et al.) |
| Source type | repository |
| Source date (published) | Unknown — not stated |
| Date researched | 2026-10-10 |
| Researched by | tai (agent), model: Muse Spark, on behalf of retoor |
| Research method | direct page fetch |
| Confidence | High |
| Status | Active |
Summary
pyte is a pure-Python in-memory VT100/VTXXX terminal emulator: a Screen keeps a buffer of text plus attributes, a Stream/ByteStream consumes raw output bytes into it. Its stated uses are screen-scraping terminal apps (htop, aptitude) and writing new terminal emulators. It began as a fork of vt102 and is licensed LGPL-3.0-only (754 stars, 122 forks at read time).
Key findings
- Architecture split:
Screen(emulation state: grid, cursor, modes) vsStream(byte parser feeding the screen);ByteStreamaccepts raw bytes, which is the pty-capture shape. - Positioned explicitly for "screen scrape terminal apps" and "write terminal emulators (graphical or web)" — the embedded-sub-terminal use case, not just testing.
- Started as a fork of vt102 (samfoo), an incomplete pure-Python VT100 implementation.
- License is LGPL-3.0-only (per repo metadata and SUSE packaging), not MIT/BSD.
- Companion tutorial (quoted in dependent sources) places the Screen "between (network, serial, pipe, ...) transport and a display".
Pros / strengths
- Existence proof that pure-Python VT emulation is fast and correct enough for real apps (htop scraping, AjaxTerm-style web terminals, PTY replay tooling).
- The Screen/Stream split is the right seam: parsing and state stay independent and separately testable.
Cons / limitations / caveats
- LGPL-3.0: cannot be vendored into tai's single-file distribution without license complications — reimplementation is required, not optional.
- README is thin on sequence coverage details; wide-character and newer xterm extension handling have historically been weak spots (not verified against current source in this pass).
Relevance to tai
- Validates the Terminal-widget design exactly: pty bytes → stream parser → screen grid → compositor paint. tai reimplements the same split (already prototyped as this session's VtScreen) with stdlib-only code.
- The LGPL finding closes the "just vendor pyte" alternative permanently.
Changelog
| Date | Change |
|---|---|
| 2026-10-10 | Initial dossier created. |