{"id":37200290,"url":"https://github.com/moncho/tcell","last_synced_at":"2026-01-14T23:02:52.546Z","repository":{"id":57480675,"uuid":"184930438","full_name":"moncho/tcell","owner":"moncho","description":"Tcell is an alternate terminal package, similar in some ways to termbox, but better in others.","archived":false,"fork":true,"pushed_at":"2019-05-04T18:42:56.000Z","size":1897,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T16:58:35.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"gdamore/tcell","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moncho.png","metadata":{"files":{"readme":"README.adoc","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}},"created_at":"2019-05-04T18:24:40.000Z","updated_at":"2019-05-04T18:42:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/moncho/tcell","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/moncho/tcell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moncho%2Ftcell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moncho%2Ftcell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moncho%2Ftcell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moncho%2Ftcell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moncho","download_url":"https://codeload.github.com/moncho/tcell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moncho%2Ftcell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28437918,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: 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":[],"created_at":"2026-01-14T23:02:51.650Z","updated_at":"2026-01-14T23:02:52.500Z","avatar_url":"https://github.com/moncho.png","language":"Go","funding_links":["https://tidelift.com/badges/github/gdamore/tcell?style=flat","https://tidelift.com/","https://www.patreon.com/gedamore/"],"categories":[],"sub_categories":[],"readme":"= tcell\n\n\nimage:https://img.shields.io/travis/gdamore/tcell.svg?label=linux[Linux Status,link=\"https://travis-ci.org/gdamore/tcell\"]\nimage:https://img.shields.io/appveyor/ci/gdamore/tcell.svg?label=windows[Windows Status,link=\"https://ci.appveyor.com/project/gdamore/tcell\"]\nimage:https://img.shields.io/badge/license-APACHE2-blue.svg[Apache License,link=\"https://github.com/gdamore/tcell/blob/master/LICENSE\"]\nimage:https://img.shields.io/badge/gitter-join-brightgreen.svg[Gitter,link=\"https://gitter.im/gdamore/tcell\"]\nimage:https://img.shields.io/badge/godoc-reference-blue.svg[GoDoc,link=\"https://godoc.org/github.com/gdamore/tcell\"]\nimage:http://goreportcard.com/badge/gdamore/tcell[Go Report Card,link=\"http://goreportcard.com/report/gdamore/tcell\"]\nimage:https://codecov.io/gh/gdamore/tcell/branch/master/graph/badge.svg[codecov,link=\"https://codecov.io/gh/gdamore/tcell\"]\nimage:https://tidelift.com/badges/github/gdamore/tcell?style=flat[Dependencies]\n\n[cols=\"2\",grid=\"none\"]\n|===\n|_Tcell_ is a _Go_ package that provides a cell based view for text terminals, like _xterm_.\nIt was inspired by _termbox_, but includes many additional improvements.\na|[.right]\nimage::logos/tcell.png[float=\"right\"]\n|===\n\n## Examples\n\n* https://github.com/gdamore/proxima5[proxima5] - space shooter (https://youtu.be/jNxKTCmY_bQ[video])\n* https://github.com/gdamore/govisor[govisor] - service management UI (http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png[screenshot])\n* mouse demo - included mouse test (http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png[screenshot])\n* https://github.com/gdamore/gomatrix[gomatrix] - converted from Termbox\n* https://github.com/zyedidia/micro/[micro] - lightweight text editor with syntax-highlighting and themes\n* https://github.com/viktomas/godu[godu] - simple golang utility helping to discover large files/folders.\n* https://github.com/rivo/tview[tview] - rich interactive widgets for terminal UIs\n* https://github.com/marcusolsson/tui-go[tui-go] - UI library for terminal apps\n* https://github.com/rgm3/gomandelbrot[gomandelbrot] - Mandelbrot!\n* https://github.com/senorprogrammer/wtf[WTF]- Personal information dashboard for your terminal\n* https://github.com/browsh-org/browsh[browsh] - A fully-modern text-based browser, rendering to TTY and browsers (https://www.youtube.com/watch?v=HZq86XfBoRo[video])\n* https://github.com/sachaos/go-life[go-life] - Conway's Game of Life.\n\n## Pure Go Terminfo Database\n\n_Tcell_ includes a full parser and expander for terminfo capability strings,\nso that it can avoid hard coding escape strings for formatting.  It also favors\nportability, and includes support for all POSIX systems.\n\nThe database is also flexible \u0026 extensible, and can modified by either running\na program to build the entire database, or an entry for just a single terminal.\n\n## More Portable\n\n_Tcell_ is portable to a wide variety of systems.\n_Tcell_ is believed\nto work with all of the systems officially supported by golang with\nthe exception of nacl (which lacks any kind of a terminal interface).\n(Plan9 is not supported by _Tcell_, but it is experimental status only\nin golang.)  For all of these systems *except Solaris/illumos*, _Tcell_\nis pure Go, with no need for CGO.\n\n## No Async IO\n\n_Tcell_ is able to operate without requiring `SIGIO` signals (unlike _termbox_),\nor asynchronous I/O, and can instead use standard Go file\nobjects and Go routines.\nThis means it should be safe, especially for\nuse with programs that use exec, or otherwise need to manipulate the\ntty streams.\nThis model is also much closer to idiomatic Go, leading\nto fewer surprises.\n\n## Rich Unicode \u0026 non-Unicode support\n\n_Tcell_ includes enhanced support for Unicode, including wide characters and\ncombining characters, provided your terminal can support them.\nNote that\nWindows terminals generally don't support the full Unicode repertoire.\n\nIt will also convert to and from Unicode locales, so that the program\ncan work with UTF-8 internally, and get reasonable output in other locales.\n_Tcell_ tries hard to convert to native characters on both input and output, and\non output _Tcell_ even makes use of the alternate character set to facilitate\ndrawing certain characters.\n\n## More Function Keys\n\n_Tcell_ also has richer support for a larger number of special keys that some terminals can send.\n\n## Better Color Handling\n\n_Tcell_ will respect your terminal's color space as specified within your terminfo\nentries, so that for example attempts to emit color sequences on VT100 terminals\nwon't result in unintended consequences.\n\nIn Windows mode, _Tcell_ supports 16 colors, bold, dim, and reverse,\ninstead of just termbox's 8 colors with reverse.  (Note that there is some\nconflation with bold/dim and colors.)\n\n_Tcell_ maps 16 colors down to 8, for terminals that need it.\n(The upper 8 colors are just brighter versions of the lower 8.)\n\n## Better Mouse Support\n\n_Tcell_ supports enhanced mouse tracking mode, so your application can receive\nregular mouse motion events, and wheel events, if your terminal supports it.\n\n## _Termbox_ Compatibility\n\nA compatibility layer for _termbox_ is provided in the `compat` directory.\nTo use it, try importing `github.com/gdamore/tcell/termbox`\ninstead.  Most _termbox-go_ programs will probably work without further\nmodification.\n\n## Working With Unicode\n\nInternally Tcell uses UTF-8, just like Go.\nHowever, Tcell understands how to\nconvert to and from other character sets, using the capabilities of\nthe `golang.org/x/text/encoding packages`.\nYour application must supply\nthem, as the full set of the most common ones bloats the program by about 2MB.\nIf you're lazy, and want them all anyway, see the `encoding` sub-directory.\n\n## Wide \u0026 Combining Characters\n\nThe `SetContent()` API takes a primary rune, and an optional list of combining runes.\nIf any of the runes is a wide (East Asian) rune occupying two cells,\nthen the library will skip output from the following cell, but care must be\ntaken in the application to avoid explicitly attempting to set content in the\nnext cell, otherwise the results are undefined.  (Normally wide character\nis displayed, and the other character is not; do not depend on that behavior.)\n\nExperience has shown that the vanilla Windows 8 console application does not\nsupport any of these characters properly, but at least some options like\n_ConEmu_ do support Wide characters.\n\n## Colors\n\n_Tcell_ assumes the ANSI/XTerm color model, including the 256 color map that\nXTerm uses when it supports 256 colors.  The terminfo guidance will be\nhonored, with respect to the number of colors supported.  Also, only\nterminals which expose ANSI style `setaf` and `setab` will support color;\nif you have a color terminal that only has `setf` and `setb`, please let me\nknow; it wouldn't be hard to add that if there is need.\n\n## 24-bit Color\n\n_Tcell_ _supports true color_!  (That is, if your terminal can support it,\n_Tcell_ can accurately display 24-bit color.)\n\nTo use 24-bit color, you need to use a terminal that supports it.  Modern\nxterm and similar teminal emulators can support this.  As terminfo lacks any\nway to describe this capability, we fabricate the capability for\nterminals with names ending in `*-truecolor`.  The stock distribution ships\nwith a database that defines `xterm-truecolor`.\nTo try it out, set your\n`TERM` variable to `xterm-truecolor`.\n\nWhen using TrueColor, programs will display the colors that the programmer\nintended, overriding any \"`themes`\" you may have set in your terminal\nemulator.  (For some cases, accurate color fidelity is more important\nthan respecting themes.  For other cases, such as typical text apps that\nonly use a few colors, its more desirable to respect the themes that\nthe user has established.)\n\nIf you find this undesirable, you can either use a `TERM` variable\nthat lacks the `TRUECOLOR` setting, or set `TCELL_TRUECOLOR=disable` in your\nenvironment.\n\n## Performance\n\nReasonable attempts have been made to minimize sending data to terminals,\navoiding repeated sequences or drawing the same cell on refresh updates.\n\n## Terminfo\n\n(Not relevent for Windows users.)\n\nThe Terminfo implementation operates with two forms of database.  The first\nis the built-in go database, which contains a number of real database entries\nthat are compiled into the program directly.  This should minimize calling\nout to database file searches.\n\nThe second is in the form of JSON files, that contain the same information,\nwhich can be located either by the `$TCELLDB` environment file, `$HOME/.tcelldb`,\nor is located in the Go source directory as `database.json`.\n\nThese files (both the Go and the JSON files) can be generated using the\nmkinfo.go program.  If you need to regnerate the entire set for some reason,\nrun the mkdatabase.sh file.  The generation uses the infocmp(1) program on\nthe system to collect the necessary information.\n\nThe `mkinfo.go` program can also be used to generate specific database entries\nfor named terminals, in case your favorite terminal is missing.  (If you\nfind that this is the case, please let me know and I'll try to add it!)\n\n_Tcell_ requires that the terminal support the `cup` mode of cursor addressing.\nTerminals without absolute cursor addressability are not supported.\nThis is unlikely to be a problem; such terminals have not been mass produced\nsince the early 1970s.\n\n## Mouse Support\n\nMouse support is detected via the `kmous` terminfo variable, however,\nenablement/disablement and decoding mouse events is done using hard coded\nsequences based on the XTerm X11 model.  As of this writing all popular\nterminals with mouse tracking support this model.  (Full terminfo support\nis not possible as terminfo sequences are not defined.)\n\nOn Windows, the mouse works normally.\n\nMouse wheel buttons on various terminals are known to work, but the support\nin terminal emulators, as well as support for various buttons and\nlive mouse tracking, varies widely.  Modern _xterm_, macOS _Terminal_, and _iTerm_ all work well.\n\n## Testablity\n\nThere is a `SimulationScreen`, that can be used to simulate a real screen\nfor automated testing.  The supplied tests do this.  The simulation contains\nevent delivery, screen resizing support, and capabilities to inject events\nand examine \"`physical`\" screen contents.\n\n## Platforms\n\n### POSIX (Linux, FreeBSD, macOS, Solaris, etc.)\n\nFor mainstream systems with a suitably well defined system call interface\nto tty settings, everything works using pure Go.\n\nFor the remainder (right now means only Solaris/illumos) we use POSIX function\ncalls to manage termios, which implies that CGO is required on those platforms.\n\n### Windows\n\nWindows console mode applications are supported.  Unfortunately _mintty_\nand other _cygwin_ style applications are not supported.\n\nModern console applications like ConEmu, as well as the Windows 10\nconsole itself, support all the good features (resize, mouse tracking, etc.)\n\nI haven't figured out how to cleanly resolve the dichotomy between cygwin\nstyle termios and the Windows Console API; it seems that perhaps nobody else\nhas either.  If anyone has suggestions, let me know!  Really, if you're\nusing a Windows application, you should use the native Windows console or a\nfully compatible console implementation.\n\n### Plan9 and Native Client (Nacl)\n\nThe nacl and plan9 platforms won't work, but compilation stubs are supplied\nfor folks that want to include parts of this in software targetting those\nplatforms.  The Simulation screen works, but as Tcell doesn't know how to\nallocate a real screen object on those platforms, `NewScreen()` will fail.\n\nIf anyone has wisdom about how to improve support for either of these,\nplease let me know.  PRs are especially welcome.\n\n### Commercial Support\n\n_Tcell_ is absolutely free, but if you want to obtain commercial, professional support, there are options.\n\n[cols=\"2\",align=\"center\",frame=\"none\", grid=\"none\"]\n|===\n^.^|\nimage:logos/tidelift.png[100,100]\na|\nhttps://tidelift.com/[Tidelift] subscriptions include support for _Tcell_, as well as many other open source packages.\n\n^.^|\nimage:logos/staysail.png[100,100]\na|\nmailto:info@staysail.tech[Staysail Systems, Inc.] offers direct support, and custom development around _Tcell_ on an hourly basis.\n\n^.^|\nimage:logos/patreon.png[100,100]\na|I also welcome donations at https://www.patreon.com/gedamore/[Patreon], if you just want to make a contribution.\n|===\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoncho%2Ftcell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoncho%2Ftcell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoncho%2Ftcell/lists"}