Commit Graph

177 Commits

Author SHA1 Message Date
Joe Grasse bac54371ba convert shift+tab to backtab 2018-04-18 13:51:55 -07:00
Garrett D'Amore 2f258105ca fixes #197 Problem on case insensitive filesystem
This changes the database to use sha1 based file names.  Its not
beautiful, but this is the BS we have to do to cope with the garbage
that is case insensitive filesystems.

Legacy databases are still honored, if you have them.
2018-04-16 09:37:43 -07:00
itchyny 2548ddfbd8 Initialize quit chan of simscreen
PollEvent should return nil when Fini is called
2018-04-02 08:53:37 -07:00
itchyny d46cfaf648 Fix InjectKey of simscreen
So that we can test for special key sequences.
2018-04-02 08:52:59 -07:00
Tyler Sommer aa381bce1b Fix data race in tScreen shutdown
Setting t.quit to nil while the mainLoop is running causes a
race condition when the Fini() method is called. This change
instead uses a select expression to avoid the nil check and set.
2018-03-20 19:13:36 -07:00
Tyler Sommer 23de111f3c Add go 1.9 and 1.10 to travis config 2018-03-20 19:11:04 -07:00
Garrett D'Amore 8fa68ef023 fixes #191 tcell hangs in go1.10
This is not so much a fix, as a workaround for an incredibly busted
tty driver in macOS.  I've tried nearly every other approach I can
think of, and this is the best of a bunch of really rotten options.

The draw back here is that reinitializing the screen may not work as well
as we'd like, and that there may be a leaked descriptor and goroutine
after you Fini() on macOS.  Not many other approaches seem viable, and to
be honest, very few applications are likely to ever notice that.

If some Apple developer sees this, please talk to me about the fixes
needed in the tty driver -- this has been a known bug (to me at least)
for many years now.
2018-02-20 10:21:48 -08:00
Garrett D'Amore 1025eab922 Add https://github.com/rgm3/gomandelbrot 2018-02-19 10:19:31 -08:00
Tony Worm 535ff868b7 Fix panic when quit chan double closed
I've been experiencing  panics occasionally/randomly on this `close(t.quit)` for double closes.

The changes seem to fix some of the obscure panics.
2018-02-16 23:21:25 -08:00
Garrett D'Amore 40c3b117ed A bit more detail about encodings and limitations. 2018-01-21 14:13:43 -08:00
Garrett D'Amore afc8e7abfb Various README updates.
First we are no longer gamma; far too many folks are now dependent
upon tcell, and we haven't changed API in an incompatible way in
a long time.

Second, add a reference to tui-go, as they switch to us from termbox.
(Good move!)

Finally, update the platform information to be a bit clearer about
where we use CGO, and update incorrect information about how the
terminfo database is built.
2018-01-11 09:23:51 -08:00
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 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