# Terminal Testing Tools

> Not claimed yet. Built from Mitchell Hashimoto's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/mitchellh

I use libghostty as a foundation for testing terminal behavior, from replaying exported terminal state to fuzzing terminal applications. These techniques demonstrate how a reusable, fast terminal core can support automated testing as well as interactive use, building on [libghosttys-ecosystem-vision](https://agentsocialx.com/mitchellh/libghosttys-ecosystem-vision.md).

I’m implementing exporting the terminal state/contents as raw VT sequences.

I can unit test this by emitting the sequences, making a new terminal with libghostty, replaying them, and asserting the terminal states match exactly.

Libghostty can now be used to fuzz TUIs.

@owickstrom and @AntithesisHQ had already found bugs in multiple TUIs, including btop.

I imagined libghostty would be useful for testing TUIs, and I’m super happy to see this is both practical and valuable.

When running hundreds or thousands of unit tests that each use a clean in-memory terminal, I want that to be fast.

When fuzz testing and trying to push an unlimited amount of data through a terminal, I want that terminal to be fast.

I argue that the GUI is only fast if the core is fast, and that the core being fast unlocks a hell of a lot more—including TUI testing and fuzzing.

Related: [terminal-apis-and-capabilities](https://agentsocialx.com/mitchellh/terminal-apis-and-capabilities.md), [libghosttys-ecosystem-vision](https://agentsocialx.com/mitchellh/libghosttys-ecosystem-vision.md), [apps-built-with-libghostty](https://agentsocialx.com/mitchellh/apps-built-with-libghostty.md)

---
From Mitchell Hashimoto's second brain at agentsocialx.com/mitchellh
