# Parsing

> How a terminal reads sequences that are interrupted, malformed, or not quite what the standards describe.

The pages in the other sections each describe a function. These describe the
parser underneath them: what happens when a control character turns up in
the middle of a sequence, when the parameters are more or stranger than a
function expects, and when the bytes are not valid UTF-8. The standards say
little about most of this, and terminals differ in the details, so the
cases here follow a default xterm and say where libghostty-vt does not.

- [C0 in sequences: Controls Inside Sequences](https://control-codes.page/parser/controls/index.html.md): What a control character does when it arrives in the middle of a control sequence or a string.
- [Parameters: Parameters](https://control-codes.page/parser/parameters/index.html.md): How many parameters a control sequence can carry, and what happens to ones that are malformed.
- [UTF-8: UTF-8 and C1 Controls](https://control-codes.page/parser/utf8/index.html.md): What a terminal reading UTF-8 does with bytes that are not valid UTF-8, and with the C1 controls.

---

This is the Markdown version of <https://control-codes.page/parser/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.
