{"id":49226557,"url":"https://github.com/mitchellh/go-libghostty","last_synced_at":"2026-04-24T08:02:32.222Z","repository":{"id":350742422,"uuid":"1207117472","full_name":"mitchellh/go-libghostty","owner":"mitchellh","description":"Go bindings for libghostty-vt.","archived":false,"fork":false,"pushed_at":"2026-04-22T20:31:29.000Z","size":173,"stargazers_count":109,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-22T22:27:09.109Z","etag":null,"topics":["ghostty","libghostty"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mitchellh/go-libghostty","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitchellh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-10T15:39:00.000Z","updated_at":"2026-04-22T21:20:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mitchellh/go-libghostty","commit_stats":null,"previous_names":["mitchellh/go-libghostty"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitchellh/go-libghostty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-libghostty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-libghostty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-libghostty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-libghostty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitchellh","download_url":"https://codeload.github.com/mitchellh/go-libghostty/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitchellh%2Fgo-libghostty/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32214420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ghostty","libghostty"],"created_at":"2026-04-24T08:02:31.491Z","updated_at":"2026-04-24T08:02:32.211Z","avatar_url":"https://github.com/mitchellh.png","language":"Go","funding_links":[],"categories":["Core \u0026 Libraries"],"sub_categories":[],"readme":"# Go Libghostty Bindings\n\nGo bindings for `libghostty-vt`.\n\nThis project uses [cgo](https://pkg.go.dev/cmd/cgo) but `libghostty-vt`\nonly depends on libc, so it is very easy to static link and very\neasy to cross-compile. The bindings default to static linking for this\nreason.\n\n\u003e [!WARNING]\n\u003e\n\u003e **I'm not promising any API stability yet.** This is a new project and the\n\u003e API may change as necessary. The underlying functionality is very stable,\n\u003e but the Go API is still being designed.\n\n## Example\n\n```go\npackage main\n\nimport (\n \"fmt\"\n \"log\"\n\n \"github.com/mitchellh/go-libghostty\"\n)\n\nfunc main() {\n term, err := libghostty.NewTerminal(libghostty.WithSize(80, 24))\n if err != nil {\n  log.Fatal(err)\n }\n defer term.Close()\n\n // Feed VT data — bold green \"world\", then plain text.\n fmt.Fprintf(term, \"Hello, \\033[1;32mworld\\033[0m!\\r\\n\")\n\n // Format the terminal contents as plain text.\n f, err := libghostty.NewFormatter(term,\n  libghostty.WithFormatterFormat(libghostty.FormatterFormatPlain),\n  libghostty.WithFormatterTrim(true),\n )\n if err != nil {\n  log.Fatal(err)\n }\n defer f.Close()\n\n output, _ := f.FormatString()\n fmt.Println(output) // Hello, world!\n}\n```\n\nMore examples are in the [`examples/`](examples/) directory.\n\n## Usage\n\nAdd the module to your Go project:\n\n```shell\ngo get github.com/mitchellh/go-libghostty\n```\n\nThis is a cgo package that links `libghostty-vt` via `pkg-config`. By\ndefault it links statically. Before building your project, you need the\nlibrary installed. Either install it system-wide or set `PKG_CONFIG_PATH`\nto point to a local checkout:\n\n```shell\nexport PKG_CONFIG_PATH=/path/to/libghostty-vt/share/pkgconfig\n```\n\nTo link dynamically instead (requires the shared library at runtime,\nso you'll also need to set the library path):\n\n```shell\ngo build -tags dynamic\n```\n\nSee the [Ghostty docs](https://ghostty.org/docs/install/build) for\nbuilding `libghostty-vt` from source.\n\n## Development\n\nCMake fetches and builds `libghostty-vt` automatically. CMake is only\nrequired and used for development of this module. For actual downstream\nusage, you can get `libghostty-vt` available however you like (e.g. system\npackage, local checkout, etc.).\n\nYou need [Zig](https://ghostty.org/docs/install/build) and CMake on your PATH.\n\n```shell\nmake build\nmake test\n\n# If in a Nix dev shell:\ngo build\ngo test\n```\n\nIf you use the Nix dev shell (`nix develop`), `go build` and `go test`\nwork directly — the shell configures all paths automatically.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-libghostty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitchellh%2Fgo-libghostty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitchellh%2Fgo-libghostty/lists"}