@@ -6,8 +6,8 @@ _Tcell_ is a _Go_ package that provides a cell based view for text terminals, li
6
6
It was inspired by _ termbox_ , but includes many additional improvements.
7
7
8
8
[ ![ Stand With Ukraine] ( https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg )] ( https://stand-with-ukraine.pp.ua )
9
- [ ![ Linux] ( https://img.shields.io/github/workflow/status/gdamore/tcell/linux? logoColor=grey&logo=linux&label= )] ( https://github.com/gdamore/tcell/actions/workflows/linux.yml )
10
- [ ![ Windows] ( https://img.shields.io/github/workflow/status/gdamore/tcell/windows? logoColor=grey&logo=windows&label= )] ( https://github.com/gdamore/tcell/actions/workflows/windows.yml )
9
+ [ ![ Linux] ( https://img.shields.io/github/actions/ workflow/status/gdamore/tcell/linux.yml?branch=main& logoColor=grey&logo=linux&label= )] ( https://github.com/gdamore/tcell/actions/workflows/linux.yml )
10
+ [ ![ Windows] ( https://img.shields.io/github/actions/ workflow/status/gdamore/tcell/windows.yml?branch=main& logoColor=grey&logo=windows&label= )] ( https://github.com/gdamore/tcell/actions/workflows/windows.yml )
11
11
[ ![ Apache License] ( https://img.shields.io/github/license/gdamore/tcell.svg?logoColor=silver&logo=opensourceinitiative&color=blue&label= )] ( https://github.com/gdamore/tcell/blob/master/LICENSE )
12
12
[ ![ Docs] ( https://img.shields.io/badge/godoc-reference-blue.svg?label=&logo=go )] ( https://pkg.go.dev/github.com/gdamore/tcell/v2 )
13
13
[ ![ Discord] ( https://img.shields.io/discord/639503822733180969?label=&logo=discord )] ( https://discord.gg/urTTxDN )
@@ -16,7 +16,7 @@ It was inspired by _termbox_, but includes many additional improvements.
16
16
17
17
Please see [ here] ( UKRAINE.md ) for an important message for the people of Russia.
18
18
19
- NOTE: This is version 2 of _ Tcell_ . There are breaking changes relative to version 1.
19
+ NOTE: This is version 2 of _ Tcell_ . There are breaking changes relative to version 1.
20
20
Version 1.x remains available using the import ` github.com/gdamore/tcell ` .
21
21
22
22
## Tutorial
@@ -25,51 +25,51 @@ A brief, and still somewhat rough, [tutorial](TUTORIAL.md) is available.
25
25
26
26
## Examples
27
27
28
- * [ proxima5] ( https://github.com/gdamore/proxima5 ) - space shooter ([ video] ( https://youtu.be/jNxKTCmY_bQ ) )
29
- * [ govisor] ( https://github.com/gdamore/govisor ) - service management UI ([ screenshot] ( http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png ) )
30
- * mouse demo - included mouse test ([ screenshot] ( http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png ) )
31
- * [ gomatrix] ( https://github.com/gdamore/gomatrix ) - converted from Termbox
32
- * [ micro] ( https://github.com/zyedidia/micro/ ) - lightweight text editor with syntax-highlighting and themes
33
- * [ godu] ( https://github.com/viktomas/godu ) - utility to discover large files/folders
34
- * [ tview] ( https://github.com/rivo/tview/ ) - rich interactive widgets
35
- * [ cview] ( https://code.rocketnine.space/tslocum/cview ) - user interface toolkit (fork of _ tview_ )
36
- * [ awsome gocui] ( https://github.com/awesome-gocui/gocui ) - Go Console User Interface
37
- * [ gomandelbrot] ( https://github.com/rgm3/gomandelbrot ) - Mandelbrot!
38
- * [ WTF] ( https://github.com/senorprogrammer/wtf ) - personal information dashboard
39
- * [ browsh] ( https://github.com/browsh-org/browsh ) - modern web browser ([ video] ( https://www.youtube.com/watch?v=HZq86XfBoRo ) )
40
- * [ go-life] ( https://github.com/sachaos/go-life ) - Conway's Game of Life
41
- * [ gowid] ( https://github.com/gcla/gowid ) - compositional widgets for terminal UIs, inspired by _ urwid_
42
- * [ termshark] ( https://termshark.io ) - interface for _ tshark_ , inspired by Wireshark, built on _ gowid_
43
- * [ go-tetris] ( https://github.com/MichaelS11/go-tetris ) - Go Tetris with AI option
44
- * [ fzf] ( https://github.com/junegunn/fzf ) - command-line fuzzy finder
45
- * [ ascii-fluid] ( https://github.com/esimov/ascii-fluid ) - fluid simulation controlled by webcam
46
- * [ cbind] ( https://code.rocketnine.space/tslocum/cbind ) - key event encoding, decoding and handling
47
- * [ tpong] ( https://github.com/spinzed/tpong ) - old-school Pong
48
- * [ aerc] ( https://git.sr.ht/~sircmpwn/aerc ) - email client
49
- * [ tblogs] ( https://github.com/ezeoleaf/tblogs ) - development blogs reader
50
- * [ spinc] ( https://github.com/lallassu/spinc ) - _ irssi_ inspired chat application for Cisco Spark/WebEx
51
- * [ gorss] ( https://github.com/lallassu/gorss ) - RSS/Atom feed reader
52
- * [ memoryalike] ( https://github.com/Bios-Marcel/memoryalike ) - memorization game
53
- * [ lf] ( https://github.com/gokcehan/lf ) - file manager
54
- * [ goful] ( https://github.com/anmitsu/goful ) - CUI file manager
55
- * [ gokeybr] ( https://github.com/bunyk/gokeybr ) - deliberately practice your typing
56
- * [ gonano] ( https://github.com/jbaramidze/gonano ) - editor, mimics _ nano_
57
- * [ uchess] ( https://github.com/tmountain/uchess ) - UCI chess client
58
- * [ min] ( https://github.com/a-h/min ) - Gemini browser
59
- * [ ov] ( https://github.com/noborus/ov ) - file pager
60
- * [ tmux-wormhole] ( https://github.com/gcla/tmux-wormhole ) - _ tmux_ plugin to transfer files
61
- * [ gruid-tcell] ( https://github.com/anaseto/gruid-tcell ) - driver for the grid based UI and game framework
62
- * [ aretext] ( https://github.com/aretext/aretext ) - minimalist text editor with _ vim_ key bindings
63
- * [ sync] ( https://github.com/kyprifog/sync ) - GitHub repo synchronization tool
64
- * [ statusbar] ( https://github.com/kyprifog/statusbar ) - statusbar motivation tool for tracking periodic tasks/goals
65
- * [ todo] ( https://github.com/kyprifog/todo ) - simple todo app
66
- * [ gosnakego] ( https://github.com/liweiyi88/gosnakego ) - a snake game
67
- * [ gbb] ( https://github.com/sdemingo/gbb ) - A classical bulletin board app for tildes or public unix servers
28
+ - [ proxima5] ( https://github.com/gdamore/proxima5 ) - space shooter ([ video] ( https://youtu.be/jNxKTCmY_bQ ) )
29
+ - [ govisor] ( https://github.com/gdamore/govisor ) - service management UI ([ screenshot] ( http://2.bp.blogspot.com/--OsvnfzSNow/Vf7aqMw3zXI/AAAAAAAAARo/uOMtOvw4Sbg/s1600/Screen%2BShot%2B2015-09-20%2Bat%2B9.08.41%2BAM.png ) )
30
+ - mouse demo - included mouse test ([ screenshot] ( http://2.bp.blogspot.com/-fWvW5opT0es/VhIdItdKqJI/AAAAAAAAATE/7Ojc0L1SpB0/s1600/Screen%2BShot%2B2015-10-04%2Bat%2B11.47.13%2BPM.png ) )
31
+ - [ gomatrix] ( https://github.com/gdamore/gomatrix ) - converted from Termbox
32
+ - [ micro] ( https://github.com/zyedidia/micro/ ) - lightweight text editor with syntax-highlighting and themes
33
+ - [ godu] ( https://github.com/viktomas/godu ) - utility to discover large files/folders
34
+ - [ tview] ( https://github.com/rivo/tview/ ) - rich interactive widgets
35
+ - [ cview] ( https://code.rocketnine.space/tslocum/cview ) - user interface toolkit (fork of _ tview_ )
36
+ - [ awsome gocui] ( https://github.com/awesome-gocui/gocui ) - Go Console User Interface
37
+ - [ gomandelbrot] ( https://github.com/rgm3/gomandelbrot ) - Mandelbrot!
38
+ - [ WTF] ( https://github.com/senorprogrammer/wtf ) - personal information dashboard
39
+ - [ browsh] ( https://github.com/browsh-org/browsh ) - modern web browser ([ video] ( https://www.youtube.com/watch?v=HZq86XfBoRo ) )
40
+ - [ go-life] ( https://github.com/sachaos/go-life ) - Conway's Game of Life
41
+ - [ gowid] ( https://github.com/gcla/gowid ) - compositional widgets for terminal UIs, inspired by _ urwid_
42
+ - [ termshark] ( https://termshark.io ) - interface for _ tshark_ , inspired by Wireshark, built on _ gowid_
43
+ - [ go-tetris] ( https://github.com/MichaelS11/go-tetris ) - Go Tetris with AI option
44
+ - [ fzf] ( https://github.com/junegunn/fzf ) - command-line fuzzy finder
45
+ - [ ascii-fluid] ( https://github.com/esimov/ascii-fluid ) - fluid simulation controlled by webcam
46
+ - [ cbind] ( https://code.rocketnine.space/tslocum/cbind ) - key event encoding, decoding and handling
47
+ - [ tpong] ( https://github.com/spinzed/tpong ) - old-school Pong
48
+ - [ aerc] ( https://git.sr.ht/~sircmpwn/aerc ) - email client
49
+ - [ tblogs] ( https://github.com/ezeoleaf/tblogs ) - development blogs reader
50
+ - [ spinc] ( https://github.com/lallassu/spinc ) - _ irssi_ inspired chat application for Cisco Spark/WebEx
51
+ - [ gorss] ( https://github.com/lallassu/gorss ) - RSS/Atom feed reader
52
+ - [ memoryalike] ( https://github.com/Bios-Marcel/memoryalike ) - memorization game
53
+ - [ lf] ( https://github.com/gokcehan/lf ) - file manager
54
+ - [ goful] ( https://github.com/anmitsu/goful ) - CUI file manager
55
+ - [ gokeybr] ( https://github.com/bunyk/gokeybr ) - deliberately practice your typing
56
+ - [ gonano] ( https://github.com/jbaramidze/gonano ) - editor, mimics _ nano_
57
+ - [ uchess] ( https://github.com/tmountain/uchess ) - UCI chess client
58
+ - [ min] ( https://github.com/a-h/min ) - Gemini browser
59
+ - [ ov] ( https://github.com/noborus/ov ) - file pager
60
+ - [ tmux-wormhole] ( https://github.com/gcla/tmux-wormhole ) - _ tmux_ plugin to transfer files
61
+ - [ gruid-tcell] ( https://github.com/anaseto/gruid-tcell ) - driver for the grid based UI and game framework
62
+ - [ aretext] ( https://github.com/aretext/aretext ) - minimalist text editor with _ vim_ key bindings
63
+ - [ sync] ( https://github.com/kyprifog/sync ) - GitHub repo synchronization tool
64
+ - [ statusbar] ( https://github.com/kyprifog/statusbar ) - statusbar motivation tool for tracking periodic tasks/goals
65
+ - [ todo] ( https://github.com/kyprifog/todo ) - simple todo app
66
+ - [ gosnakego] ( https://github.com/liweiyi88/gosnakego ) - a snake game
67
+ - [ gbb] ( https://github.com/sdemingo/gbb ) - A classical bulletin board app for tildes or public unix servers
68
68
69
69
## Pure Go Terminfo Database
70
70
71
71
_ Tcell_ includes a full parser and expander for terminfo capability strings,
72
- so that it can avoid hard coding escape strings for formatting. It also favors
72
+ so that it can avoid hard coding escape strings for formatting. It also favors
73
73
portability, and includes support for all POSIX systems.
74
74
75
75
The database is also flexible & extensible, and can be modified by either running
@@ -114,7 +114,7 @@ For example attempts to emit color sequences on VT100 terminals
114
114
won't result in unintended consequences.
115
115
116
116
In legacy Windows mode, _ Tcell_ supports 16 colors, bold, dim, and reverse,
117
- instead of just termbox's 8 colors with reverse. (Note that there is some
117
+ instead of just termbox's 8 colors with reverse. (Note that there is some
118
118
conflation with bold/dim and colors.)
119
119
Modern Windows 10 can benefit from much richer colors however.
120
120
@@ -127,7 +127,7 @@ _Tcell_ supports enhanced mouse tracking mode, so your application can receive
127
127
regular mouse motion events, and wheel events, if your terminal supports it.
128
128
129
129
(Note: The Windows 10 Terminal application suffers from a flaw in this regard,
130
- and does not support mouse interaction. The stock Windows 10 console host
130
+ and does not support mouse interaction. The stock Windows 10 console host
131
131
fired up with cmd.exe or PowerShell works fine however.)
132
132
133
133
## _ Termbox_ Compatibility
@@ -152,7 +152,7 @@ The `SetContent()` API takes a primary rune, and an optional list of combining r
152
152
If any of the runes is a wide (East Asian) rune occupying two cells,
153
153
then the library will skip output from the following cell. Care must be
154
154
taken in the application to avoid explicitly attempting to set content in the
155
- next cell, otherwise the results are undefined. (Normally the wide character
155
+ next cell, otherwise the results are undefined. (Normally the wide character
156
156
is displayed, and the other character is not; do not depend on that behavior.)
157
157
158
158
Older terminal applications (especially on systems like Windows 8) lack support
@@ -161,42 +161,42 @@ for advanced Unicode, and thus may not fare well.
161
161
## Colors
162
162
163
163
_ Tcell_ assumes the ANSI/XTerm color model, including the 256 color map that
164
- XTerm uses when it supports 256 colors. The terminfo guidance will be
165
- honored, with respect to the number of colors supported. Also, only
164
+ XTerm uses when it supports 256 colors. The terminfo guidance will be
165
+ honored, with respect to the number of colors supported. Also, only
166
166
terminals which expose ANSI style ` setaf ` and ` setab ` will support color;
167
167
if you have a color terminal that only has ` setf ` and ` setb ` , please submit
168
168
a ticket.
169
169
170
170
## 24-bit Color
171
171
172
- _ Tcell_ _ supports 24-bit color!_ (That is, if your terminal can support it.)
172
+ _ Tcell_ _ supports 24-bit color!_ (That is, if your terminal can support it.)
173
173
174
174
NOTE: Technically the approach of using 24-bit RGB values for color is more
175
175
accurately described as "direct color", but most people use the term "true color".
176
176
We follow the (inaccurate) common convention.
177
177
178
178
There are a few ways you can enable (or disable) true color.
179
179
180
- * For many terminals, we can detect it automatically if your terminal
181
- includes the ` RGB ` or ` Tc ` capabilities (or rather it did when the database
182
- was updated.)
180
+ - For many terminals, we can detect it automatically if your terminal
181
+ includes the ` RGB ` or ` Tc ` capabilities (or rather it did when the database
182
+ was updated.)
183
183
184
- * You can force this one by setting the ` COLORTERM ` environment variable to
185
- ` 24-bit ` , ` truecolor ` or ` 24bit ` . This is the same method used
186
- by most other terminal applications that support 24-bit color.
184
+ - You can force this one by setting the ` COLORTERM ` environment variable to
185
+ ` 24-bit ` , ` truecolor ` or ` 24bit ` . This is the same method used
186
+ by most other terminal applications that support 24-bit color.
187
187
188
- * If you set your ` TERM ` environment variable to a value with the suffix ` -truecolor `
189
- then 24-bit color compatible with XTerm and ECMA-48 will be assumed.
190
- (This feature is deprecated.
191
- It is recommended to use one of other methods listed above.)
188
+ - If you set your ` TERM ` environment variable to a value with the suffix ` -truecolor `
189
+ then 24-bit color compatible with XTerm and ECMA-48 will be assumed.
190
+ (This feature is deprecated.
191
+ It is recommended to use one of other methods listed above.)
192
192
193
- * You can disable 24-bit color by setting ` TCELL_TRUECOLOR=disable ` in your
194
- environment.
193
+ - You can disable 24-bit color by setting ` TCELL_TRUECOLOR=disable ` in your
194
+ environment.
195
195
196
196
When using TrueColor, programs will display the colors that the programmer
197
197
intended, overriding any "` themes ` " you may have set in your terminal
198
- emulator. (For some cases, accurate color fidelity is more important
199
- than respecting themes. For other cases, such as typical text apps that
198
+ emulator. (For some cases, accurate color fidelity is more important
199
+ than respecting themes. For other cases, such as typical text apps that
200
200
only use a few colors, its more desirable to respect the themes that
201
201
the user has established.)
202
202
@@ -210,7 +210,7 @@ avoiding repeated sequences or drawing the same cell on refresh updates.
210
210
(Not relevant for Windows users.)
211
211
212
212
The Terminfo implementation operates with a built-in database.
213
- This should satisfy most users. However, it can also (on systems
213
+ This should satisfy most users. However, it can also (on systems
214
214
with ncurses installed), dynamically parse the output from ` infocmp `
215
215
for terminals it does not already know about.
216
216
@@ -227,8 +227,8 @@ since the early 1970s.
227
227
228
228
Mouse support is detected via the ` kmous ` terminfo variable, however,
229
229
enablement/disablement and decoding mouse events is done using hard coded
230
- sequences based on the XTerm X11 model. All popular
231
- terminals with mouse tracking support this model. (Full terminfo support
230
+ sequences based on the XTerm X11 model. All popular
231
+ terminals with mouse tracking support this model. (Full terminfo support
232
232
is not possible as terminfo sequences are not defined.)
233
233
234
234
On Windows, the mouse works normally.
@@ -241,21 +241,21 @@ Modern _xterm_, macOS _Terminal_, and _iTerm_ all work well.
241
241
## Bracketed Paste
242
242
243
243
Terminals that appear to support the XTerm mouse model also can support
244
- bracketed paste, for applications that opt-in. See ` EnablePaste() ` for details.
244
+ bracketed paste, for applications that opt-in. See ` EnablePaste() ` for details.
245
245
246
246
## Testability
247
247
248
248
There is a ` SimulationScreen ` , that can be used to simulate a real screen
249
- for automated testing. The supplied tests do this. The simulation contains
249
+ for automated testing. The supplied tests do this. The simulation contains
250
250
event delivery, screen resizing support, and capabilities to inject events
251
251
and examine "` physical ` " screen contents.
252
252
253
253
## Platforms
254
254
255
255
### POSIX (Linux, FreeBSD, macOS, Solaris, etc.)
256
256
257
- Everything works using pure Go on mainstream platforms. Some more esoteric
258
- platforms (e.g., AIX) may need to be added. Pull requests are welcome!
257
+ Everything works using pure Go on mainstream platforms. Some more esoteric
258
+ platforms (e.g., AIX) may need to be added. Pull requests are welcome!
259
259
260
260
### Windows
261
261
@@ -268,15 +268,15 @@ support all the good features (resize, mouse tracking, etc.)
268
268
269
269
These platforms won't work, but compilation stubs are supplied
270
270
for folks that want to include parts of this in software for those
271
- platforms. The Simulation screen works, but as _ Tcell_ doesn't know how to
271
+ platforms. The Simulation screen works, but as _ Tcell_ doesn't know how to
272
272
allocate a real screen object on those platforms, ` NewScreen() ` will fail.
273
273
274
274
If anyone has wisdom about how to improve support for these,
275
- please let me know. PRs are especially welcome.
275
+ please let me know. PRs are especially welcome.
276
276
277
277
### Commercial Support
278
278
279
279
_ Tcell_ is absolutely free, but if you want to obtain commercial, professional support, there are options.
280
280
281
- * [ TideLift] ( https://tidelift.com/ ) subscriptions include support for _ Tcell_ , as well as many other open source packages.
282
- * [ Staysail Systems Inc.
] ( mailto:[email protected] ) offers direct support, and custom development around
_ Tcell
_ on an hourly basis.
281
+ - [ TideLift] ( https://tidelift.com/ ) subscriptions include support for _ Tcell_ , as well as many other open source packages.
282
+ - [ Staysail Systems Inc.
] ( mailto:[email protected] ) offers direct support, and custom development around
_ Tcell
_ on an hourly basis.
0 commit comments