{"id":28762397,"url":"https://github.com/fortio/terminal","last_synced_at":"2026-02-14T03:59:35.221Z","repository":{"id":252117554,"uuid":"829566183","full_name":"fortio/terminal","owner":"fortio","description":"2 libraries + utilities: readline style command history and terminal drawing/images, fps calculator","archived":false,"fork":false,"pushed_at":"2026-01-16T23:10:25.000Z","size":5465,"stargazers_count":44,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-17T11:32:49.029Z","etag":null,"topics":["fps","frame-per-second","golang","image","terminal","tui"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fortio.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":null,"dco":null,"cla":null}},"created_at":"2024-07-16T17:33:34.000Z","updated_at":"2026-01-16T23:09:06.000Z","dependencies_parsed_at":"2024-08-07T20:55:47.882Z","dependency_job_id":"37526190-b5f3-4af3-9912-e88a6227e804","html_url":"https://github.com/fortio/terminal","commit_stats":null,"previous_names":["grol-io/terminal"],"tags_count":137,"template":false,"template_full_name":null,"purl":"pkg:github/fortio/terminal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortio%2Fterminal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortio%2Fterminal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortio%2Fterminal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortio%2Fterminal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fortio","download_url":"https://codeload.github.com/fortio/terminal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortio%2Fterminal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28857110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"ssl_error","status_checked_at":"2026-01-28T22:56:00.861Z","response_time":57,"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":["fps","frame-per-second","golang","image","terminal","tui"],"created_at":"2025-06-17T08:08:27.608Z","updated_at":"2026-01-29T00:11:35.116Z","avatar_url":"https://github.com/fortio.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/fortio/terminal)\n# terminal\n\nFortio's terminal has 2 distinct components and a number of utilities built on the second one.\n\nReadline style terminal and more vs Low level ansipixels terminal control and drawing:\n\n\n## fortio.org/terminal\n[![Go Reference](https://pkg.go.dev/badge/fortio.org/terminal.svg)](https://pkg.go.dev/fortio.org/terminal)\n\n\n`fortio.org/terminal` is a `readline` style library. It handles prompts, edit (like Ctrl-A for beginning of line etc...), navigating through history using arrow keys, loading and saving history from file, etc... It works on everywhere go does (including macOS, Windows (using Terminal app), Linux).\n\nSee [example/main.go](example/main.go) for a rather complete example/demo.\n\nSee the godoc above for details.\n\nThe [grol](https://github.com/grol-io/grol#grol) command line repl and others use this.\n\nThe implementations currently is a wrapper fully encapsulating [golang.org/x/term](https://github.com/golang/term), with configurable History and new features like the interrupts handling (filters Ctrl-C ahead of term' reads)\n\n## fortio.org/terminal/ansipixels\n[![Go Reference](https://pkg.go.dev/badge/fortio.org/terminal/ansipixels.svg)](https://pkg.go.dev/fortio.org/terminal/ansipixels)\n\nA much lower level library that allow direct control of both the input and the output of the terminal, including mouse tracking, clicks, drag events and modifiers, mousewheel decoding/querying and many functions to emit the corresponding [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) (colors, cursor positioning etc). It include basic named colors, RGB colors, and Hue,Saturation,Luminance conversion to RGB as well as RGB to closest 256 color conversion for non truecolor terminals, in [ansipixels/tcolor](ansipixels/tcolor/) sub package.\n\nDo feel free to use [fortio.org/progressbar](https://github.com/fortio/progressbar) as well\n\nSee [fortio.org/tclock](https://github.com/fortio/tclock) for an additional demo of what this can do.\n\n## FPS\n\nThe tagged release of `ansipixels` used to includes a standalone binary, `fps`, that uses that package to test your terminal frames per second capabilities.\n\nSee the source [github.com/fortio/fps/fps.go](https://github.com/fortio/fps/blob/main/fps.go)\n\nYou can get the binary from [fps releases](https://github.com/fortio/fps/releases)\n\nOr just run (path is unchanged/preserved from original location)\n```sh\nCGO_ENABLED=0 go install fortio.org/terminal/fps@latest  # to install or just\nCGO_ENABLED=0 go run fortio.org/terminal/fps@latest  # to run without install\n```\n\nor even\n```sh\ndocker run -ti fortio/fps # but that's obviously slower\n```\n\nor\n```sh\nbrew install fortio/tap/fps\n```\n\nUse the `-image` flag to pass a different image to load as background. Or use `-i` and fps is now just a terminal image viewer (in addition to keys, you can now zoom using the mousewheel, click to move the image - see `?` for help).\n\nPass an optional `maxfps` as argument.\n\nE.g `fps -image my.jpg 60` will run at 60 fps with `my.jpg` as background.\n\nAfter hitting any key to start the measurement, you can also resize the window at any time and fps will render with the new size.\nUse `q` to stop.\n\n![fps screenshot](fps_sshot.png)\n\nImage viewer screenshot:\n\n![fps image viewer](fps_image_viewer.png)\n\nDetailed statistics are saved in a JSON files and can be visualized or compared by running [fortio report](https://github.com/fortio/fortio#installation)\n\n![fps fortio histogram](histogram.png)\n\nHot (!) off the press a new `-fire` mode for fps (with space to toggle on/off and `i` to turn off the text):\n\n\u003cimg width=\"1058\" alt=\"FPS Fire mode\" src=\"https://github.com/user-attachments/assets/dae6cfd5-1e6c-4674-808e-93b89cc6f47f\"\u003e\n\n\n### Usage\n\nAdditional flags/command help:\n```\nfps 0.27.0 usage:\n        fps [flags] [maxfps] or fps -i imagefiles...\nor 1 of the special arguments\n        fps {help|envhelp|version|buildinfo}\nflags:\n  -color\n        If your terminal supports color, this will load image in (216) colors instead of monochrome\n  -fire\n        Show fire animation instead of RGB around the image\n  -gray\n        Convert the image to grayscale\n  -i    Arguments are now images files to show, no FPS test (hit any key to continue)\n  -image string\n        Image file to display in monochrome in the background instead of the default one\n  -n number of frames\n        Start immediately an FPS test with the specified number of frames (default is interactive)\n  -nobox\n        Don't draw the box around the image, make the image full screen instead of 1 pixel less on all sides\n  -nojson\n        Don't output json file with results that otherwise get produced and can be visualized with fortio report\n  -nomouse\n        Disable mouse tracking\n  -truecolor\n        If your terminal supports truecolor, this will load image in truecolor (24bits) instead of monochrome (default true)\n```\n\n## Game of life\n\nSee [life/](life/) for a classic Conway's game of life black and white demo (with resizing, mouse edits, etc... supported).\n\nSame installation as above, just replace `fps` by `life`.\n\n![life screenshot](life/life.png)\n\n## Blackjack\n\nSee [blackjack/](blackjack/) for a classic blackjack game against dealer.\n\nSame installation as above, just replace `fps` by `blackjack`.\n\n![blackjack screenshot](blackjack/blackjack.png)\n\n\n## Brick\n\nPlay an old time favorite, or watch replays of saved games... or even let the computer play!\n\nSee the options below.\n\n![brick screenshot](brick.png)\n\n```\nbrick 0.20.0 usage:\n\tbrick [flags]\nor 1 of the special arguments\n\tbrick {help|envhelp|version|buildinfo}\nflags:\n  -autoplay\n    \tComputer plays mode\n  -fps float\n    \tFrames per second (default 30)\n  -lives int\n    \tNumber of lives - 0 is infinite (default 3)\n  -nodeath\n    \tNo death mode\n  -nosave\n    \tDon't save the game as JSON (default is to save)\n  -replay game\n    \tReplay a game from a JSON file\n  -seed seed\n    \tRandom number generator seed, default (0) is time based\n```\n\nLike for the others, to try if you have go:\n```shell\ngo run fortio.org/terminal/brick@latest\n```\nor pick a binary from the [releases](https://github.com/fortio/terminal/releases)\n\n\n## Nocolor\n\n`nocolor` is a very simple unix style filter ([source code](https://github.com/fortio/terminal/blob/main/nocolor/nocolor.go#L42), uses [ansipixels.AnsiClean](https://pkg.go.dev/fortio.org/terminal/ansipixels#AnsiClean)): it removes all ansi codes from the input stream and writes the filtered version, color free, to stdout.\n\nTo install if you have go:\n```shell\ngo install fortio.org/terminal/nocolor@latest\n# then\nsomethingProducingColors | nocolor\n```\n\nOr on a mac\n```sh\nbrew install fortio/tap/nocolor\n```\n\nOr pick a binary from the [releases](https://github.com/fortio/terminal/releases)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortio%2Fterminal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffortio%2Fterminal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortio%2Fterminal/lists"}