1
0
mirror of https://github.com/gdamore/tcell.git synced 2025-04-26 13:48:53 +08:00

116 Commits

Author SHA1 Message Date
Garrett D'Amore
82b7404080 fix regression caused by #177 in cleaning up
The defer of the screen.Fini() needed to include the defer of the
app.wg.Done(), and the original wg.Done needed to be eliminated.
The problem was originally spotted by @thechriswalker, with a proposed
fix that was close but not quite correct.
2018-01-08 09:49:58 -08:00
Garrett D'Amore
329140c26c Add @rivo's tview package (looks cool!) 2018-01-08 09:31:29 -08:00
Jason E. Aten
1ef2313da8 fix #172, don't crash on empty name string on call to LookupTerminfo 2018-01-08 08:47:47 -08:00
Joshua T Corbin
d400d66308 Defer screen finish in app run 2017-12-25 02:13:52 -08:00
Joshua T Corbin
e07997cdf1 Fix simscreen.SetSize 2017-12-25 02:12:38 -08:00
Joshua T Corbin
426c2dbca3 Update terminfo database 2017-12-25 02:11:46 -08:00
Graham Clark
996a3f0a68 Fix up the two screen terminfo sgr0 sequences. 2017-12-17 15:52:28 -08:00
Graham Clark
99cec24157 Parse terminfo values containing numbers expressed in octal syntax.
I noticed that when running a tcell application under tmux using
TERM=screen-256color, some text rendered with style attributes
like bold and underline appeared preceded with "17". This seemed
to come from tcell sending "AttrOff"/sgr0, which in
term_screen_256xcolor.go looks like:

AttrOff:      "\x1b[m\x0017"

infocmp screen-256color expresses sgr0 like this:

sgr0=\E[m\017

This terminfo man page implies that \017 should be interpreted as
the octal representation of 15 decimal.

https://www.mkssoftware.com/docs/man5/terminfo.5.asp

The terminfo generator mkinfo.go parses the \0 as a zero, then
the following 17 as the digits 1 and 7. This patch modifies
mkinfo.go and results in the following instead

AttrOff:      "\x1b[m\x0f"

This seems to clear up the "17" problem for me. But I am not a
terminal expert by any means, so perhaps my interpretation is
incorrect!
2017-12-17 15:52:28 -08:00
Garrett D'Amore
5626083ca1 Revised logo. 2017-11-24 20:34:25 -08:00
Garrett D'Amore
b65f8b54bf Add logo. 2017-11-24 20:31:33 -08:00
Garrett D'Amore
6e0ee420a5 Add support and donation link. 2017-11-24 16:04:27 -08:00
Garrett D'Amore
061d51a604 fixes #169 data race between inputLoop and mainLoop v1.0.0 2017-11-24 15:55:02 -08:00
Garrett D'Amore
ade89fc294 Add st terminal entries (www.suckless.org)
We add st, st-meta, and the -256color and -truecolor variants.
Note that the -truecolor variant was NOT described in the st.info
file, but st uses the same color escapes that everyone else does
for 24-bit color.
2017-11-24 15:27:54 -08:00
Garrett D'Amore
c0b0191744 Fix database for case insensitive file systems and truecolor. 2017-11-24 14:14:35 -08:00
Garrett D'Amore
8f08469772 fixes #167 Break up the database
This completely restructures the database of terminal types, putting
each terminal in its own file.  We also compress the database files,
and use infocmp instead of trying to use the C level API.

The mkdatabase script will rebuild the entire database from the terminfo
files on the system.  Individual entries can also be built by simply running
the mkinfo program with the terminal type.
2017-11-24 13:13:06 -08:00
Garrett D'Amore
87c64c441a Post an error event on receiving an error from the input. 2017-09-25 07:14:38 -07:00
Garrett D'Amore
50f9ed7673 fixes #129 Very high IDLE_WAKE - Power consumption
fixes #164 KeyEscape does not work in Go 1.9 under Linux

This is a complete refactor of the input loop for UNIX systems.
We use a blocking reader on the TTY, and a separate select
loop for timers and other events.  This means that our idle
use should be low now.
2017-09-23 23:25:24 -07:00
Michael Smith
0a0db94084 Fix cScreen.Fini() race condition (#158) (#159)
* Fix cScreen.Fini() race condition

Closes gdamore/tcell#158

* Tidy up Windows magic, and fix event ordering

* Move a couple of magic values into constants
* Add more explanatory comments
* Fix ordering WaitForMultipleObjects to give cancellation priority
* Also correct some indentation and minor formatting stuff.

* Use `chan struct{}` for `scandone` to not deadlock
2017-09-14 23:17:52 -07:00
Adam Bozanich
582c2db721 boxlayout: handle widget removal (#160) 2017-09-14 23:13:49 -07:00
Garrett D'Amore
d55f61ca94 Correct details about when CGO is needed. 2017-08-07 10:11:46 -07:00
Garrett D'Amore
c349f64807 Add codecov badge. 2017-08-07 09:58:11 -07:00
Garrett D'Amore
831f7d0487 Adding codecov coverage tooling. 2017-08-07 09:48:45 -07:00
Garrett D'Amore
98527ba5f4 Update to stop testing against "old" golang.
We test 1.5 and newer only.  Arguably we could probably stop testing
anything older than 1.7, but some folks will still be using older
versions of golang.  Note that 1.3 is definitely busted.
2017-08-06 17:20:58 -07:00
Tomas
6c10f39931 Adding Widget Resize to BoxLayout function (#140)
- Widget might be using not just View but other mechanisms for rendering
  aware of the view size (e.g. ViewPort).
- By updating the view reference out of Widget, Widget doesn't have a
  chance to react on this layout algorithm
- That's an existing bug that happens when we try to use CellView inside
  of an BoxLayout
2017-08-06 10:36:27 -07:00
Tomas Vik
57a866e10c Adding Widget Resize to BoxLayout function
- Widget might be using not just View but other mechanisms for rendering
  aware of the view size (e.g. ViewPort).
- By updating the view reference out of Widget, Widget doesn't have a
  chance to react on this layout algorithm
- That's an existing bug that happens when we try to use CellView inside
  of an BoxLayout
2017-08-06 10:31:10 -07:00
Kim Tore Jensen
01ac1e4067 Document and publish color names and RGB values. (#151)
* Document and publish color names and RGB values.

* Fix failing tests.
2017-06-20 20:27:38 -07:00
Frank Braun
1f66b72172 views: move method call out of the inner loop
No need to retrieve the same values multiple times.
2017-06-20 20:13:35 -07:00
Frank Braun
b87161466d views: fix corner case for limitCursor()
If m.width and m.height have not been initialized yet m.x and m.y would
be set to -1. Changing the order fixes that.
2017-06-20 20:13:35 -07:00
Frank Braun
440aba81dc Remove unnecessary initialization
window.updatesKeys() is called anyway
2017-06-20 20:10:52 -07:00
Frank Braun
9b7bd5c526 Remove unused struct field 2017-06-20 20:10:52 -07:00
Kim Tore Jensen
62d7350d17 Make keyNames variable public (#144)
* Make keyNames variable public

This map of variables might be useful to applications wanting to convert text to keys, e.g. for key bindings.

* Document KeyNames variable
2017-05-01 11:23:58 -10:00
Alexey Grachov
e552b82b28 Fix typo in readme. (#139) 2017-05-01 07:57:32 -10:00
Camille
ebcef4d8a3 mkdatabase.sh: Use sh instead of ksh (#149)
* mkdatabase.sh: Use sh instead of ksh

* mkdatabase.sh: Actually make it sh insead of dash...
2017-05-01 07:56:27 -10:00
Tomas
6d5ea857af Mention godu in Examples section (#141) 2017-05-01 07:50:55 -10:00
Jaime Piña
44772c121b Fix small lint & spelling issues 2016-12-06 09:19:16 -08:00
Garrett D'Amore
6b28764250 Add Junegunn Choi <junegunn.c@gmail.com> to AUTHORS. 2016-12-04 13:06:37 -08:00
Junegunn Choi
d4838882df
Fix display of 24-bit background with default foreground 2016-11-25 16:26:21 +09:00
Kiril Vladimiroff
a7344e526a Return actual time of key event creation 2016-10-19 14:37:42 -07:00
Garrett D'Amore
c52de15673 fixes #119 Restore Windows terminal colors 2016-10-19 14:21:13 -07:00
Garrett D'Amore
d94cafee62 fixes #126 Mouse tracking in Putty does not work
fixes #128 mkinfo could search $HOME/.terminfo
2016-10-19 12:14:22 -07:00
Nickolay
ebe6908e0b Update README.md (#123)
This adds the excellent micro editor to the list of sample applications.
2016-09-25 17:16:04 -07:00
vagrant
2e10b659dd fixes #118 Recognizing more terminals
fixes #121 Linux LC_ALL lacks charset suffix
2016-09-03 05:32:55 +00:00
Garrett D'Amore
ad43f8729b fixes #117 Add PGUP, PGDN, HOME, and END key handling to TextArea 2016-05-24 01:26:09 -07:00
Garrett D'Amore
c3e5bc256f fixes #116 Various improvements to tcell Views API 2016-05-24 00:50:38 -07:00
Garrett D'Amore
e05a300454 fixes #113 Create SimpleStyledTextBar (forgot git add) 2016-05-23 15:30:37 -07:00
Garrett D'Amore
91d5e748ae fixes #114 Add Fill() method View API
fixes #113 Create SimpleStyledTextBar
2016-05-23 14:55:11 -07:00
Garrett D'Amore
114688d248 fixes #112 SimpleStyledText could have simpler & more powerful API 2016-05-23 13:13:23 -07:00
Garrett D'Amore
02686d5300 fixes #103 ShiftAlt + arrows and ShiftCtrl + arrows 2016-05-19 16:45:31 -07:00
Garrett D'Amore
2af553baed fixes #91 why add a CSI before each SGR attribute? 2016-05-19 11:35:33 -07:00
Garrett D'Amore
94116f345e fixes #111 compat broken by KeySpace 2016-05-18 23:00:47 -07:00