terminal-tui-debugging

Debug and verify interactive terminal UIs using PTY tests and Terminal MCP sessions.

1|Updated Sep 3, 2017
One-click install
npx skills add https://github.com/mmgeorge/config --skill terminal-tui-debugging-mmgeorge
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: terminal-tui-debugging
Source: https://github.com/mmgeorge/config/tree/main/.rulesync/skills/terminal-tui-debugging
Command: npx skills add https://github.com/mmgeorge/config --skill terminal-tui-debugging-mmgeorge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Interactive terminal applications draw by emitting byte streams to a pseudo-terminal, making defects in cursor motion, redraw timing, colors, alternate screen buffers, and resize handling hard to reproduce and verify with ordinary unit tests. ## Core Features & Use Cases - Layered Testing Hierarchy: Guides you to reproduce failures at the lowest layer possible, from model tests and render snapshots up to PTY tests and live Terminal MCP sessions. - Terminal MCP Integration: Drives live interactive sessions with explicit dimensions, sequential keystroke dispatch, screen buffer inspection, ANSI/PNG screenshots, and asciicast recording for tools like Neovim, fzf, pagers, and custom TUIs. - Framework-Specific Test Matrix: The references/testing-matrix.md reference covers Ratatui, Bubble Tea, OpenTUI, Textual, Neovim, and generic CLI testing patterns. - Use Case: When a ratatui app misrenders after a terminal resize, spawn it in an isolated Terminal MCP session at the failing dimensions, dispatch inputs, capture the screen buffer, and isolate the defect mechanism. ## Quick Start Use the terminal-tui-debugging skill to reproduce and diagnose the rendering glitch in my TUI app at 80x24 terminal dimensions.

Frequently Asked Questions about terminal-tui-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a terminal TUI application that renders incorrectly?▼

Spawn the application in an isolated Terminal MCP session at the failing terminal dimensions, wait for a stable frame, then dispatch one input at a time and capture the screen buffer after each step. Compare the observed buffer against the expected visual state to isolate the defect.

What testing layers should I use for terminal UI regression tests?▼

Use four layers: model tests for state transitions and keymaps, render tests for deterministic frame snapshots at fixed sizes, PTY tests for ANSI escapes and resize handling, and Terminal MCP sessions for live interactive diagnosis. Test at the lowest layer that reproduces the failure.

How do I test a Bubble Tea or Ratatui app without a real terminal?▼

For Bubble Tea, unit-test Update and View directly and use teatest for fixed-size output and synthetic key messages. For Ratatui, use ratatui::backend::TestBackend with snapshot testing via insta, reserving tmux or PTY harnesses for real resize behavior.

Can I test Neovim plugins that depend on visible terminal state?▼

Use pure Lua tests for parsing and layout math, headless Neovim child processes for plugin APIs and buffers, and RPC for inspecting editor state. Use Terminal MCP when the visible surface matters, such as floating windows, splits, cursor, colors, and redraw.

Why does my TUI behave differently at different terminal sizes?▼

Layout behavior depends on terminal dimensions, so always create sessions with the exact failing cols and rows or record the default dimensions when reporting defects. Resize events propagate through SIGWINCH, which PTY tests can validate explicitly.

When should I use asciicast recording instead of automated tests?▼

Use startRecording and stopRecording to capture complex or timing-dependent defects as asciicast artifacts for human replay and documentation. Recordings are not the primary correctness oracle; automated model, render, and PTY tests should carry regression coverage.