{"id":13435078,"url":"https://github.com/nsf/termbox","last_synced_at":"2025-05-15T12:05:03.417Z","repository":{"id":787663,"uuid":"483770","full_name":"nsf/termbox","owner":"nsf","description":"Library for writing text-based user interfaces","archived":false,"fork":false,"pushed_at":"2020-08-25T15:20:53.000Z","size":562,"stargazers_count":1985,"open_issues_count":20,"forks_count":188,"subscribers_count":76,"default_branch":"master","last_synced_at":"2025-04-14T22:18:26.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://code.google.com/p/termbox","language":"C","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/nsf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-01-22T12:52:15.000Z","updated_at":"2025-04-13T15:18:44.000Z","dependencies_parsed_at":"2022-07-05T15:00:22.100Z","dependency_job_id":null,"html_url":"https://github.com/nsf/termbox","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsf%2Ftermbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsf%2Ftermbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsf%2Ftermbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsf%2Ftermbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsf","download_url":"https://codeload.github.com/nsf/termbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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":[],"created_at":"2024-07-31T03:00:32.115Z","updated_at":"2025-05-15T12:04:58.402Z","avatar_url":"https://github.com/nsf.png","language":"C","readme":"## IMPORTANT\n\nThis library is no longer maintained. It's pretty small if you have a big\nproject that relies on it, just maintain it yourself. Or look for forks. Or look\nfor alternatives. Or better - avoid using terminals for UI. Never the less, thanks\nto all who ever contributed.\n\n## Termbox\n\nTermbox is a library that provides minimalistic API which allows the\nprogrammer to write text-based user interfaces.\n\nIt is based on a very simple abstraction. The main idea is viewing terminals as\na table of fixed-size cells and input being a stream of structured\nmessages. Would be fair to say that the model is inspired by windows console\nAPI. The abstraction itself is not perfect and it may create problems in certain\nareas. The most sensitive ones are copy \u0026 pasting and wide characters (mostly\nChinese, Japanese, Korean (CJK) characters). When it comes to copy \u0026 pasting,\nthe notion of cells is not really compatible with the idea of text. And CJK\nrunes often require more than one cell to display them nicely. Despite the\nmentioned flaws, using such a simple model brings benefits in a form of\nsimplicity. And KISS principle is important.\n\nAt this point one should realize, that CLI (command-line interfaces) aren't\nreally a thing termbox is aimed at. But rather pseudo-graphical user interfaces.\n\n### Installation\n\nTermbox comes with a waf-based build scripts. In order to configure, build and\ninstall it, do the following::\n\n```\n./waf configure --prefix=/usr                                (configure)\n./waf                                                        (build)\n./waf install --destdir=DESTDIR                              (install)\n```\n\nBy default termbox will install the header file and both shared and static\nlibraries. If you want to install a shared library or static library alone, use\nthe following as an install command::\n\n```\n./waf install --targets=termbox_shared --destdir=PREFIX      (shared library)\n```\n\nor::\n\n```\n./waf install --targets=termbox_static --destdir=PREFIX      (static library)\n```\n\n##### Python\n\nIn order to install the python module, use the following command (as root or\nvia sudo)::\n\n```\npython setup.py install\n```\n\nfor Python 3::\n\n```\npython3 setup.py install\n```\n\n### Getting started\n\nTermbox's interface only consists of 12 functions::\n\n```\ntb_init() // initialization\ntb_shutdown() // shutdown\n\ntb_width() // width of the terminal screen\ntb_height() // height of the terminal screen\n\ntb_clear() // clear buffer\ntb_present() // sync internal buffer with terminal\n\ntb_put_cell()\ntb_change_cell()\ntb_blit() // drawing functions\n\ntb_select_input_mode() // change input mode\ntb_peek_event() // peek a keyboard event\ntb_poll_event() // wait for a keyboard event\n```\n\nSee src/termbox.h header file for full detail.\n\n### Links\n\nIf you want me to add your Termbox project here, send me a pull request or drop\na note via email, you can find my email below.\n\n##### Language bindings\n\n- https://github.com/nsf/termbox - Python\n- https://github.com/adsr/termbox-php - PHP\n- https://github.com/gchp/rustbox - Rust\n- https://github.com/fouric/cl-termbox - Common Lisp\n- https://github.com/zyedidia/termbox-d - D\n- https://github.com/dduan/Termbox - Swift\n- https://github.com/andrewsuzuki/termbox-crystal - Crystal\n- https://github.com/jgoldfar/Termbox.jl - Julia\n- https://github.com/mitchellwrosen/termbox - Haskell\n- https://github.com/dom96/nimbox - Nim\n- https://github.com/ndreynolds/ex_termbox - Elixir\n- https://github.com/bmsauer/termbox-ada - Ada\n- https://github.com/luxint/termbox - newLISP\n\n##### Other implementations\n\n- https://github.com/nsf/termbox-go - Go pure Termbox implementation\n\n##### Applications\n\n- https://github.com/adsr/mle - a small, flexible terminal-based text editor\n- https://github.com/colinta/Ashen - framework for building terminal applications based on the Elm architecture\n- https://github.com/afify/sfm - simple file manager for unix-like systems\n\n### Bugs \u0026 questions\n\nReport bugs to the https://github.com/nsf/termbox issue tracker. Send rants\nand questions to me: no.smile.face@gmail.com.\n\n### Changes\n\nv1.1.2:\n\n- Properly include changelog into the tagged version commit. I.e. I messed up\n  by tagging v1.1.1 and describing it in changelog after tagged commit. This\n  commit marked as v1.1.2 includes changelog for both v1.1.1 and v1.1.2. There\n  are no code changes in this minor release.\n\nv1.1.1:\n\n- Ncurses 6.1 compatibility fix. See https://github.com/nsf/termbox-go/issues/185.\n\nv1.1.0:\n\n- API: tb_width() and tb_height() are guaranteed to be negative if the termbox\n  wasn't initialized.\n- API: Output mode switching is now possible, adds 256-color and grayscale color\n  modes.\n- API: Better tb_blit() function. Thanks, Gunnar Zötl \u003cgz@tset.de\u003e.\n- API: New tb_cell_buffer() function for direct back buffer access.\n- API: Add new init function variants which allow using arbitrary file\n  descriptor as a terminal.\n- Improvements in input handling code.\n- Calling tb_shutdown() twice is detected and results in abort() to discourage\n  doing so.\n- Mouse event handling is ported from termbox-go.\n- Paint demo port from termbox-go to demonstrate mouse handling capabilities.\n- Bug fixes in code and documentation.\n\nv1.0.0:\n\n- Remove the Go directory. People generally know about termbox-go and where\n  to look for it.\n- Remove old terminfo-related python scripts and backport the new one from\n  termbox-go.\n- Remove cmake/make-based build scripts, use waf.\n- Add a simple terminfo database parser. Now termbox prefers using the\n  terminfo database if it can be found. Otherwise it still has a fallback\n  built-in database for most popular terminals.\n- Some internal code cleanups and refactorings. The most important change is\n  that termbox doesn't leak meaningless exported symbols like 'keys' and\n  'funcs' now. Only the ones that have 'tb_' as a prefix are being exported.\n- API: Remove unsigned ints, use plain ints instead.\n- API: Rename UTF-8 functions 'utf8_*' -\u003e 'tb_utf8_*'.\n- API: TB_DEFAULT equals 0 now, it means you can use attributes alones\n  assuming the default color.\n- API: Add TB_REVERSE.\n- API: Add TB_INPUT_CURRENT.\n- Move python module to its own directory and update it due to changes in the\n  termbox library.\n","funding_links":[],"categories":["CLI","C","Utilities","库 Libraries","公用事业","Uncategorized"],"sub_categories":["YAML","命令行 Command-line","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsf%2Ftermbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsf%2Ftermbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsf%2Ftermbox/lists"}