Go bindings for libghostty-vt. pkg.go.dev/go.mitchellh.com/libghostty
ghostty

render: add RenderStateRowIterator.AppendText for row text master

Reading the text of a row previously meant walking every cell from Go with RenderStateRowCells.Next and AppendGraphemes. That is at least two cgo calls per cell, so reading an 80x30 screen costs about 4,800 cgo calls. Programs that inspect terminal text on every update, rather than render it, pay that on each read. AppendText reads the whole current row in one cgo call. A small C helper loops over the cells using the existing GRAPHEMES_UTF8 getter, so cell text and encoding match the per-cell API exactly. No libghostty changes are needed. Empty cells between characters become spaces, empty cells at the end of the row are dropped, and the spare cell of a wide character produces nothing. If dst fills up partway through a row, the helper reports where it stopped and how much room it needs, and AppendText grows dst and resumes. On an 80x30 screen this takes 9 to 13us with no allocations, compared to 103 to 133us for the cheapest per-cell loop and 118 to 274us for a per-cell loop that handles wide characters correctly. The benchmark checks that both approaches produce the same text before timing them.