{"id":20289954,"url":"https://github.com/byte-cats/gt","last_synced_at":"2026-04-29T21:36:50.825Z","repository":{"id":133201965,"uuid":"446166990","full_name":"Byte-Cats/gt","owner":"Byte-Cats","description":"Terminal Emulator But In Go","archived":false,"fork":false,"pushed_at":"2022-10-21T20:59:19.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-14T08:52:26.037Z","etag":null,"topics":["go","gui","linux","terminal"],"latest_commit_sha":null,"homepage":"","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/Byte-Cats.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}},"created_at":"2022-01-09T18:12:19.000Z","updated_at":"2022-10-15T01:51:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"1db437bb-4132-4bb9-b82d-bdb5144076ab","html_url":"https://github.com/Byte-Cats/gt","commit_stats":null,"previous_names":["4cecoder/gt"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byte-Cats%2Fgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byte-Cats%2Fgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byte-Cats%2Fgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Byte-Cats%2Fgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Byte-Cats","download_url":"https://codeload.github.com/Byte-Cats/gt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241787487,"owners_count":20020099,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","gui","linux","terminal"],"created_at":"2024-11-14T15:05:40.377Z","updated_at":"2026-04-29T21:36:50.820Z","avatar_url":"https://github.com/Byte-Cats.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\";\u003e\n\n# gt\nGo Terminal \n## Minimalist Terminal emulator written in Go\n\n\u003c/div\u003e\n\n\n### Desired Feature Set\n\n- Image Preview (PNG, JPEG, GIF, BMP, TIFF, WebP)\n- Supports 256 colors\n- Scrollable Text Buffer\n- UTF-8 support\n\n### Features\n\n*   **PTY Integration:** Runs shell commands via a pseudo-terminal.\n*   **SDL2 Rendering:** Uses SDL2 and SDL_ttf for graphical output.\n*   **Color Support:** Handles 16-color, 256-color, and TrueColor (24-bit) escape sequences.\n*   **Text Attributes:** Supports Bold (via font variant), Underline, and Reverse Video.\n*   **Scrollback:** Basic scrollback buffer navigable via Mouse Wheel.\n*   **Enhanced Inline Image Protocol:** Displays and manages inline images using an extended iTerm2-compatible protocol.\n*   **Wide Character Support:** Basic handling for wide characters.\n\n### Enhanced Image Support\n\n`gt` supports displaying and manipulating inline images using an **Extended iTerm2 Image Protocol**. This enhanced protocol offers powerful features like z-index layering, alignment control, and persistent images.\n\nTo display an image, an application running inside `gt` needs to output a specific escape sequence to standard output:\n\n```\nESC ] 1337 ; File=inline=1 [;options...] : BASE64DATA ST\n```\n\nWhere:\n*   `ESC` is the escape character (`\\x1b`).\n*   `ST` is the String Terminator, which can be BEL (`\\a`, `\\x07`) or `ESC \\` (`\\x1b\\\\`).\n*   `BASE64DATA` is the base64-encoded content of the image file.\n*   `[;options...]` are optional key-value pairs separated by semicolons. \n\n#### Basic Options:\n*   `width=N`: Specify width in character cells (`N`), pixels (`Npx`), or percentage of terminal width (`N%`). `auto` uses native width.\n*   `height=N`: Specify height similarly (cells, `Npx`, `N%`). `auto` uses native height.\n*   `preserveAspectRatio=1|0`: Whether to maintain aspect ratio (default is 1/true).\n\n#### Advanced Options:\n*   `max-width=N`: Maximum width in pixels (`0` = unlimited).\n*   `max-height=N`: Maximum height in pixels (`0` = unlimited).\n*   `z-index=N`: Layering order, higher values appear on top (default is `0`).\n*   `align=left|center|right`: Horizontal image alignment (default is `left`).\n*   `name=ID`: Optional identifier for image manipulation.\n*   `persistent=1|0`: If `1`, image remains when cursor moves (default is `0`).\n\n**Example Scripts:**\n\nA simple Python script is provided in `contrib/load_image.py`:\n\n```bash\npython contrib/load_image.py /path/to/your/image.png\n```\n\nFor advanced features, try the demo script:\n\n```bash\npython contrib/advanced_image_demo.py --image-dir /path/to/images/\n```\n\nFor complete API documentation, see `docs/image_api.md`.\n\n### Configuration\n\n`gt` can be configured via a TOML file located at `~/.config/gt/theme.toml`.\n\nA default configuration file (`theme.default.toml`) is included in the project root. Copy this file to `~/.config/gt/theme.toml` and modify it to change settings like:\n\n*   Font path and size\n*   Terminal colors (foreground, background, cursor, 16 ANSI colors)\n\nIf the configuration file is not found or is invalid, `gt` will use built-in default values.\n\n**Applying Themes:**\n\nTo make changing themes easier, a helper script is provided:\n\n```bash\n# Make sure it's executable\nchmod +x contrib/set_gt_theme.sh\n\n# Apply a theme file (e.g., one you downloaded or created)\n./contrib/set_gt_theme.sh /path/to/some_other_theme.toml\n```\n\nThis script copies the specified theme file to `~/.config/gt/theme.toml`. Restart `gt` after applying a new theme.\n\n### Build from source\n```bash\ngo mod init \u0026\u0026 go mod tidy \u0026\u0026 go build\n```\n\n### Reaserch References\n\n[C in go slideshow](http://akrennmair.github.io/golang-cgo-slides/#3)\n\n[Rewrite vs Revive](https://medium.com/mysterium-network/golang-c-interoperability-caf0ba9f7bf3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyte-cats%2Fgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyte-cats%2Fgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyte-cats%2Fgt/lists"}