We had problems where if $TERM was set on a Windows console, we would
fail to allocate the screen because of missing termios. This caused
lots of problems for many Windows users. This should make this easier
for folks who might have set $TERM for other reasons, even in a Windows
console environment.
Eventually we will want to support emitting characters for 256 color
support, but that's later.
This expands support for 24-bit color for terminals that support the
ISO 8613-6:1994 escape sequences (same as xterm), allowing this support
to be enabled by setting % COLORTERM to "truecolor" (or 24bit or 24-bit),
or by setting TCELL_TRUECOLOR to "on", or by setting $TERM a value that
ends in the word "-truecolor".
As this is handled by the runtime now, we no longer need to create magical
database entries for -truecolor options.
A colors.go demo is provided to show off 24-bit color support.
While go-convey was pretty nice, it carries a rather large dependency
graph, which we think it is better not to burden our downstreams with.
It is easy enough to just refactor the tests to use the standard testing
package.
* SetContent() now makes a copy of the combining characters slice. Avoids unexpected side effects when original slice is reused/modified. Fixes#215
* Appending combining characters to an empty rune slice instead of making a copy.
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.