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.
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.
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.
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.
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.
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!
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.
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.
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.
* Fix cScreen.Fini() race condition
Closesgdamore/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
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.
- 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
- 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
* 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