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

199 Commits

Author SHA1 Message Date
Garrett D'Amore
48f88019c3 fixes #243 Ordering of SetConsoleWindowInfo and SetConsoleScreenBufferSize 2019-03-19 00:22:32 -07:00
Garrett D'Amore
2fca0432ba Windows should always try for console first.
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.
2019-03-19 00:07:29 -07:00
otani_koji
f0cffc65c6 fixes #250 Some characters disappear on Windows 2019-03-18 23:57:44 -07:00
Garrett D'Amore
d195cc757c fixes #264 tcell breaks grapheme clusters 2019-03-18 23:41:32 -07:00
Garrett D'Amore
77ab683d7d Improve 24-bit color support.
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.
2019-03-18 22:47:05 -07:00
Sam Whited
aaadc574a6 Support Go Modules v1.1.1 2018-12-20 13:25:34 -08:00
Garrett D'Amore
af444b941a Refactor tests to avoid go-convey.
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.
2018-12-18 21:33:43 -08:00
Garrett D'Amore
017915a4d7
Remove grid from support table. 2018-10-29 16:12:21 -07:00
Garrett D'Amore
483884f06f Convert to asciidoctor, add more support details, incl. Tidelift. 2018-10-26 08:00:31 -04:00
Takumasa Sakao
8e3efba094 Update README.md 2018-10-24 09:14:50 -04:00
Garrett D'Amore
493f3b46b3 fixes #225 Kitty missing from terminfo database 2018-09-23 22:52:37 -07:00
Garrett D'Amore
a5810f6e8f fixes #236 CellBuffer.Fill doesn't set cell.width 2018-09-23 19:58:37 -07:00
Garrett D'Amore
a24b9b6b1c fixes #238 views: BoxLayout.Draw does unnecessary filling 2018-09-23 19:54:34 -07:00
Garrett D'Amore
86147f14ef fixes #233 Want zero-width joiners support 2018-09-05 18:42:39 -04:00
Tobi
61bec9bcda Update README.md
Add browsh to the list of examples.
2018-09-05 08:48:50 -04:00
ia
de7e78efa4 all: gofmt
Run standard gofmt command on project root.

- go version go1.10.3 darwin/amd64

Signed-off-by: ia <isaac.ardis@gmail.com>
v1.1.0
2018-06-23 12:52:09 -07:00
Martin Angers
2efc922424 add termite terminfo 2018-06-23 12:51:08 -07:00
Chris Cummer
b3cebc399d Add WTF to the list of Examples in README (#221) 2018-06-08 10:24:21 -07:00
zeromus
a41c5658c8 docs typo encoodings -> encodings (#220) 2018-06-07 20:53:23 -07:00
rivo
3d5f294a6f SetContent() now makes a copy of the combining characters slice. (#216)
* 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.
2018-05-03 09:57:25 -07:00
Thomas Wouters
5ddf16a669 Allow octal and hexadecimal conversion to int
Auto detect the base as implied by `0` or `0x` prefixes.

Fixes #212
2018-04-23 06:10:09 -07:00
Xurane
91a5452278 disable quick edit mode on EnableMouse() in win10 2018-04-23 06:06:46 -07:00
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 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