{"id":14529993,"url":"https://github.com/BigJk/crt","last_synced_at":"2025-09-02T01:31:03.419Z","repository":{"id":164338574,"uuid":"639753998","full_name":"BigJk/crt","owner":"BigJk","description":"Minimal terminal emulator for Bubbletea.","archived":false,"fork":false,"pushed_at":"2024-05-09T17:55:10.000Z","size":7872,"stargazers_count":97,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-07T18:52:14.177Z","etag":null,"topics":["ebiten","ebitengine","go","golang","terminal","terminal-emulator"],"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/BigJk.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}},"created_at":"2023-05-12T06:41:42.000Z","updated_at":"2025-03-27T11:51:27.000Z","dependencies_parsed_at":"2024-05-09T19:04:08.777Z","dependency_job_id":"4c66b961-b0a0-40d7-aa6f-fd38afd164f3","html_url":"https://github.com/BigJk/crt","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/BigJk/crt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fcrt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fcrt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fcrt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fcrt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BigJk","download_url":"https://codeload.github.com/BigJk/crt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BigJk%2Fcrt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273218387,"owners_count":25065913,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ebiten","ebitengine","go","golang","terminal","terminal-emulator"],"created_at":"2024-09-05T00:01:04.007Z","updated_at":"2025-09-02T01:31:01.794Z","avatar_url":"https://github.com/BigJk.png","language":"Go","funding_links":[],"categories":["Applications"],"sub_categories":["Development Tools"],"readme":"# crt — *cathode-ray tube*\n\n![Screenshot](./.github/screenshot.png)\n\n## About\n\nCRT is a library to provide a simple terminal emulator that can be attached to a ``tea.Program``. It uses ``ebitengine`` to render a terminal. It supports TrueColor, Mouse and Keyboard input. It interprets the CSI escape sequences coming from bubbletea and renders them to the terminal.\n\nThis started as a simple proof of concept for the game I'm writing with the help of bubbletea, called [End Of Eden](https://github.com/BigJk/end_of_eden). I wanted to give people who have no clue about the terminal a simple option to play the game without interacting with the terminal directly. It's also possible to apply shaders to the terminal to give it a more retro look which is a nice side effect.\n\n## Usage\n\n```\ngo get github.com/BigJk/crt@latest\n```\n\n\n```go\npackage main\n\nimport (\n\t\"github.com/BigJk/crt\"\n\tbubbleadapter \"github.com/BigJk/crt/bubbletea\"\n\ttea \"github.com/charmbracelet/bubbletea\"\n\t\"github.com/charmbracelet/lipgloss\"\n\t\"image/color\"\n)\n\n// Some tea.Model ...\n\nfunc main() {\n\t// Load fonts for normal, bold and italic text styles.\n\tfonts, err := crt.LoadFaces(\"./fonts/SomeFont-Regular.ttf\", \"./fonts/SomeFont-Bold.ttf\", \"./fonts/SomeFont-Italic.ttf\", crt.GetFontDPI(), 16.0)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Just pass your tea.Model to the bubbleadapter, and it will render it to the terminal.\n\twin, _, err := bubbleadapter.Window(1000, 600, fonts, someModel{}, color.Black, tea.WithAltScreen())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// Star the terminal with the given title.\n\tif err := win.Run(\"Simple\"); err != nil {\n\t\tpanic(err)\n\t}\n}\n```\n\nSee more examples in the ``/examples`` folder!\n\n## Limitations\n\n- ~~Only supports TrueColor at the moment (no 256 color support) so you need to use TrueColor colors in lipgloss (e.g. ``lipgloss.Color(\"#ff0000\")``)~~ **Now supported.**\n- Not all CSI escape sequences are implemented but the ones that are used by bubbletea are implemented\n- Key handling is a bit quirky atm. Ebiten to bubbletea key mapping is not perfect and some keys are not handled correctly yet.\n- A lot of testing still needs to be done and there are probably edge cases that are not handled correctly yet\n\n## Credits\n\n- Basic CRT Shader ``./shader/crt_basic``: https://quasilyte.dev/blog/post/ebitengine-shaders/\n- Lottes CRT Shader ``./shader/crt_lotte``: Elias Daler https://github.com/eliasdaler/crten and Timothy Lottes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBigJk%2Fcrt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBigJk%2Fcrt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBigJk%2Fcrt/lists"}