惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
J
Java Code Geeks
L
LangChain Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
博客园 - Franky
Microsoft Azure Blog
Microsoft Azure Blog
Jina AI
Jina AI
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
博客园 - 司徒正美
B
Blog
G
Google Developers Blog
Stack Overflow Blog
Stack Overflow Blog
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
Engineering at Meta
Engineering at Meta
MyScale Blog
MyScale Blog
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog

Show HN

Show HN: AI agents for UK GDAD PCF roles and their skills The Two Pillars: Mixer Mode and Meta-Software in the Reorganization of Software Work After AI GitHub - JaiCode08/teleport-env What 1,000+ Harness Experiments Taught Me About Self-Improving Agents Show HN: Liiists, a Markdown-first, iOS and CLI list app SwiperTab – Get this Extension for 🦊 Firefox (en-US) GitHub - kouhxp/fftext: Summarize, explain, fact-check, or translate any text, URL, or file. No GPU. No cloud. One command GitHub - sweetpad-dev/sweetpad: Develop Swift/iOS projects using VSCode GitHub - dogmaticdev/IRON: IRON a.k.a. Intermediate Representation Object Notation is a Interpreter/Database that is used to create Programming Languages. GitHub - sjhalani7/vaen: Package your AI coding harness into a portable .agent file, and share it across repos, teams, & the community without ever having to copy-paste instructions, skills, MCP config, or secrets. Show HN: Gandalf the Grader Show HN: Citadeld – replay any CI failure locally from a single file GitHub - tdortman/cuSBF: High-Performance GPU Super Bloom Filter coral-ai/claude-code-token-xray at main · Coral-Bricks-AI/coral-ai GitHub - ulyssestenn/funes: Funes is a Git-based framework for LLM-managed knowledge work: an AI Librarian ingests raw sources, builds an interlinked Markdown knowledge base, and uses it to produce cited reports, analyses, and other outputs. GitHub - ThatXliner/gah: Git Add Hunk, built for agents to use GitHub - harmont-dev/harmont-cli: Command-line client for the Harmont CI platform GitHub - brooksmcmillin/mcp-authflow: OAuth 2.0 Authorization Server framework for MCP servers GitHub - javaid-codes/audit-supply-chain-agents GitHub - amorey/gochan: A small library of common channel architectures for Go, inspired by Rust GitHub - arifozgun/OpenGem: Free, Open-Source AI API Gateway with Gemini, OpenAI & Anthropic Compatibility in 1 file GitHub - Pranesh950/BioPetals: 🌸 Run BIOxAI models at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading GitHub - cnguyen14/bounty-doctor: Diagnose a GitHub bounty issue before you waste hours: detects honeypot scam repos, AI-bot attempt swarms, and stale contests. Show HN: CoreMCP – MCP Server for On-Prem DBs Show HN: KittyHTML – Render HTML/CSS as an inline image in your terminal GitHub - bingud/filemat: Web-based file manager Show HN: TruthLens – Free multi-signal deepfake image detector GitHub - apexlocal-jz/claude-usage-tray: Windows system-tray app showing your Claude Code rate-limit usage at a glance. Zero deps, ~300 lines of PowerShell. Cross-IDE (works regardless of VS Code, Cursor, plain terminal). Release v0.1.2.1 · kouhxp/yapsnap GitHub - noopolis/moltnet: Self-hostable chat network for AI agents. Pre-built bridges for Claude Code, Codex, and the Claws. Rooms, DMs, history. No Slack bots, no Matrix, no glue code.
GitHub - vidarh/rubyterm: Tiny ruby terminal for X11
vidarh · 2026-06-16 · via Show HN

A terminal emulator written entirely in Ruby — including a pure-Ruby X11 client to talk to the X server and a pure-Ruby font renderer.

There is no C extension and no libvte; the escape-sequence interpreter, the screen buffer, the rendering and the X11 protocol handling are all Ruby.

It is still rough and opinionated, but it now runs as an installable gem with a rubyterm executable, renders with a damage-driven pipeline (scrollback, text selection/copy, truecolor and UTF-8 all work), and is split into a reusable terminal engine that can be driven without X11 at all.

NOTE: Escape-code coverage is partial (VT100/VT102 plus a useful chunk of xterm), font handling is basic, and the keymap is limited. It is slow, though it is my main driver. Full-screen apps mostly work; some will still misbehave. I have specific ideas about direction, so if you'd like to contribute, talk to me first (vidar@hokstad.com) or fork — I won't promise to merge changes we haven't discussed.

Screenshots of Ruby-in-Ruby-in-Ruby-...

Rubyterm

This shows Rubyterm running on my Ruby based WM, running Rubyterm with a text-based-backend that renders a a terminal to text (so it can run in any terminal), running my editor Re editing the Rubyterm example. The text is rendered using the pure-Ruby TrueType font renderer Skrift, and connected to my X11 server using the Pure-X11 Ruby X11 bindings (no libX or XCB, just pure Ruby socket code).

Architecture

The code is deliberately small and split along clean seams so the pieces are independently usable and testable:

  • Engine — the escape interpreter (Term), the damage tracker (TrackChanges), the columnar screen buffer (TermBuffer) and the escape/UTF-8 parsers. No pixels, no X11; drivable headlessly.
  • Backends — anything implementing the small drawing interface:
    • Window — the pure-Ruby X11 backend (the real terminal);
    • AnsiBackend — re-emits to an ANSI/escape stream (run a terminal inside another terminal; see examples/terminal_in_terminal.rb);
    • BitmapWindow — rasterises glyphs with skrift into an in-memory RGB buffer (headless rendering / visual testing, PNG output).
  • ApplicationRubyTerm (in lib/rubyterm/app.rb), which owns the X window, the pty controller and the input/blink/flush threads and wires the engine to the X11 backend. bin/rubyterm runs it.

Rendering is damage-driven: writing a cell only mutates the buffer and bumps a per-cell generation; a flush walks the damage and redraws just the changed cells. A flood of output (an accidental cat of a large file) is jump-scrolled — interpreted across many chunks and painted once.

For the full picture and the rationale behind the layering, see:

  • docs/architecture-review.md — the architecture critique, the phased refactoring plan, and the Ruby performance notes (with measured results).
  • docs/seams.md — the layer seams: the screen-operation API and the backend drawing protocol.

Installation

Dependencies are managed with Bundler.

skrift and skrift-x11 are developed alongside this project and are pulled from git. To build against a local checkout instead of the pushed branch, set a per-machine local override (kept out of the repo):

bundle config set --global local.skrift     /path/to/skrift
bundle config set --global local.skrift-x11 /path/to/skrift-x11

Running

bundle exec rubyterm                 # start a terminal running your $SHELL
bundle exec rubyterm bash -lc htop   # ...or run a specific command

With some luck you'll get a terminal window. Once the gem (and its dependencies) are installed system-wide, the rubyterm executable can be run directly.

Configuration

Configuration is read from ~/.config/rterm/config.toml (TOML). See example-config.toml for a complete example. If the file is absent, defaults are used.

  • shell — path to the shell to launch. Defaults to $SHELL, then /bin/sh. Example: shell = "/bin/bash".
  • fonts — fonts to use, in priority order; later fonts cover glyphs missing from earlier ones. Each entry may be a direct path ("~/fonts/MyFont.ttf"), a file in ~/.local/share/fonts/, or a name resolved via fc-match ("monospace", "monospace:weight=bold").
  • fontsize — font size in points (e.g. fontsize = 24).
  • width / height — initial window size in pixels; the terminal grid is derived from it and the font cell size. Defaults to 1000 x 600 (~80×24 at the default font); on a big display, e.g. width = 2000 / height = 1200.
  • deccolm — how the 80/132-column DECCOLM switch is realised: "font" (rescale the glyph cell, the default) or "window" (ask the WM to resize).
shell = "/bin/zsh"
fonts = [
  "FiraCode-Regular.ttf",   # programming font
  "unifont-15.0.06.ttf",    # Unicode fallback
  "monospace"               # system fallback
]
fontsize = 24

Development

rake test          # the minitest unit/integration suite
rake run           # run the terminal (alias for bin/rubyterm)

There is a deterministic test harness for terminal correctness: it runs cases through the engine and an oracle (tmux), diffs the resulting screen state, and gates regressions with a ratchet. It can also record and replay real applications, and run an instrumented live terminal with a debug socket.

ruby harness/cli.rb run   --case cases/synthetic/dch.bin --oracle tmux
ruby harness/cli.rb sweep --cases cases --oracle tmux --ratchet ratchet.json

Direction

Where I want to take this:

  • Keep the engine fully decoupled from the pty and X11 so Ruby applications can instantiate a "terminal" with an IO object as its interface — the first consumer being my own text editor — and package the engine as a gem. (The split exists; the gem and the editor migration are in progress.)
  • Make the terminal complete enough to run most Unix command-line tools: a reasonably complete, Unicode-aware xterm/VT100.
  • Keep the code small but understandable. Terseness is valued only while it preserves readability.

Resources