ghostling-libghostty-terminal — Claude Code skill: terminal
A skill that walks through building a minimal terminal emulator on the libghostty-vt C library, with Raylib handling windows and rendering.
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a claude-codeWhat ghostling-libghostty-terminal does
Everything lives in one main.c: VT sequence parsing, terminal state, cursor, styles, text reflow and scrollback. The render state API is the interesting part — it hands you only the cells that changed, so you never redraw the whole grid each frame.
Windowing, rendering, PTY management, tabs and splits are outside the library. You bring those yourself. In the example Raylib draws the cells, and the pseudo-terminal comes from openpty plus fork. Keyboard and mouse events get encoded into escape sequences by libghostty-vt, Kitty keyboard protocol included.
Build needs CMake 3.19+, Ninja, a C compiler and Zig 0.15.x on PATH. Debug builds crawl because Ghostty keeps its safety assertions on, so benchmark Release or the numbers mean nothing.
What it helps with
- parse VT sequences inside your own app
- embed terminal emulation into an existing C project
- draw only the changed grid cells instead of the full screen
- set up a PTY and wire it to terminal state
- encode key presses and mouse events into escape sequences
Example prompts for the agent
- Show me how to create a terminal with libghostty-vt and feed it bytes from the PTY
- Build a minimal terminal emulator with libghostty-vt and Raylib following the ghostling example
- How do I walk the render state and draw only the dirty cells?
How to install ghostling-libghostty-terminal
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a claude-code2Manually: put the files in place
~/.claude/skills/ghostling-libghostty-terminal/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/ghostling-libghostty-terminal/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a codex2Manually: put the files in place
.agents/skills/ghostling-libghostty-terminal/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a cursor2Manually: put the files in place
.cursor/skills/ghostling-libghostty-terminal/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install reason-machines/trending-skills ghostling-libghostty-terminal2Manually: put the files in place
.github/skills/ghostling-libghostty-terminal/SKILL.md1Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a gemini-cli2Platform CLI
gemini skills install https://github.com/reason-machines/trending-skills --path skills/ghostling-libghostty-terminalManually: put the files in place
.devin/skills/ghostling-libghostty-terminal/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about ghostling-libghostty-terminal
How do I install ghostling-libghostty-terminal in Claude?
Run npx skills add reason-machines/trending-skills --skill ghostling-libghostty-terminal -a claude-code. The skill file lands at ~/.claude/skills/ghostling-libghostty-terminal/SKILL.md.
What does ghostling-libghostty-terminal do?
It steps through building a terminal emulator on libghostty-vt: initialization, writing PTY data, keyboard and mouse input, resizing, scrolling, and drawing through the render state.
What do I need before using it?
CMake 3.19+, Ninja, a C compiler and Zig 0.15.x on PATH. The library does not provide windowing or PTY handling, so you supply those.