Commit Graph

481 Commits

Author SHA1 Message Date
Garrett D'Amore 7946eb8e8d Wait for output to drain.
Hopefully this fixes unpredicatable output when the program is stopping.
2021-06-10 07:33:55 -07:00
Garrett D'Amore 65821462b5 Close the tty device when finishing. 2021-06-10 06:55:56 -07:00
Garrett D'Amore 15d485cfb5 Add a stdin version of Tty, and handle unset terminal sizes sanely. 2021-06-07 12:58:03 -07:00
Garrett D'Amore da8f2067c0 Reset colors to default on suspend.
For most terminals this also is done with 'sgr0', but on some it
appears that we need to explicitly use the 'oc' capability.  (This
is the documented behavior in terminfo.)
2021-06-05 05:36:16 -07:00
Will Daly b7e369fb8d Add aretext to the list of examples in the README
Aretext is a minimalist text editor with vim key bindings.
2021-06-05 05:30:19 -07:00
Hubert Hirtz 0fb69aed47 Add support for the foot terminal
https://codeberg.org/dnkl/foot
2021-06-05 05:29:41 -07:00
Garrett D'Amore 4f213fd72d Make sun-color 256 color by default, and just drop the sun-256color. 2021-06-01 20:43:32 -07:00
Garrett D'Amore dcf5866e16 Permit a different device node to be used as /dev/tty. 2021-06-01 18:59:24 -07:00
Garrett D'Amore d8ae9d764a Add xterm-direct, which gives 24-bit color. 2021-06-01 14:36:48 -07:00
Garrett D'Amore cad1b2a3f3 Add sun-256color as a builtin. 2021-05-31 18:08:06 -07:00
Garrett D'Amore 3687c97d3d Sun terminal color fixes.
This addresses problems in the color handling found on Sun and illumos
consoles.  The infocmp for these terminals is buggy as well.
2021-05-31 17:59:55 -07:00
Garrett D'Amore c43eafe245 Fix for writing in last column of last line for automargin terminals. 2021-05-18 23:17:00 -07:00
Garrett D'Amore a3de596932 Fabricate entries for -256color if they don't exist (xterm colors) 2021-05-18 20:20:43 -07:00
Garrett D'Amore 5c5a66e2b0 fix panic on resize (regression) 2021-05-16 11:38:02 -07:00
Garrett D'Amore f0385f8cb3 Use https for goreportcard. 2021-05-16 09:39:53 -07:00
Garrett D'Amore 7a0b45cce0 fixes #422 RFE: Handling events in batches 2021-05-16 09:21:17 -07:00
Garrett D'Amore 0bfa151864 fixes #460 Possible race condition between Fini and PollEvent 2021-05-16 09:04:18 -07:00
Yon 876e1fdeb5 Add gruid-tcell to the list of examples in the README
gruid-tcell is a tcell-based driver for the grid-based UI and game
framework gruid.
2021-05-16 08:42:56 -07:00
Garrett D'Amore 97c0480839 fixes #452 Lost a key event once when exiting or suspending in v2.2.1.
fixes #449 Lost keyboard input after suspend on Windows 10 PowerShell
fixes #148 Make tcell usable with any io.Reader and io.Writer

This introduces a new Tty interface so that applications can supply
their own implementation.  This should facilitate work for applications
that wish to provide e.g. a webasm version of the terminal, or that need
to use different kinds of file plumbing.
2021-05-16 08:27:27 -07:00
Spenser Black 8f925d8272 Implement FromImageColor
Converts from `image/color.Color` to `tcell.Color`.
2021-05-11 12:36:10 -07:00
Garrett D'Amore 299cb413dc Add a sample style to hello world. 2021-04-18 12:26:17 -07:00
Garrett D'Amore 0c349a85f4 Remove stale (unused) code in Windows finish. 2021-04-18 12:05:27 -07:00
Garrett D'Amore fb06997fe2 fixes #445 Prompt Cursor Lost after Suspend v2.2.0 Windows PowerShell 2021-04-18 12:04:21 -07:00
Garrett D'Amore 356d48f50a Fix link display. Thanks to @noborus. 2021-04-18 11:54:14 -07:00
Graham Clark 1febfd418d Add tmux-wormhole to the list of tcell-dependent apps
I published this yesterday on github. It's a tmux plugin that scrapes
the active tmux pane for a magic wormhole code, then downloads and
optionally opens the file tied to the code. I wrote this to make it
easier to get pcaps from termshark into Wireshark. This plugin uses
gowid which itself depends wholly on tcell to manipulate the
terminal. Link: https://github.com/gcla/tmux-wormhole
2021-04-18 11:52:41 -07:00
Noboru Saito 7694d90821 Change to /dev/tty because term.GetState fails
The file descriptor of "os.Stdin"
may cause term.GetState to be an error.
2021-04-18 11:50:21 -07:00
Gokcehan 14c5375ccc send enter_keypad during terminal engage 2021-04-18 11:38:12 -07:00
Gokcehan d003d0a0a1 switch back to ca mode after suspend/resume
Suspend call currently exits ca mode. So after the first suspend/resume
the program does not use the alternate screen anymore. Therefore Resume
needs to enter ca mode again.
2021-04-18 11:38:12 -07:00
bobo liu e37d20eeec fixes PollEvent() hung after Fini() on windows 2021-04-18 11:31:00 -07:00
Noboru Saito f4d402906f Added terminal pager ov to examples 2021-03-04 22:05:00 -08:00
Garrett D'Amore c94849e7d5 Remove go1.11 from travis matrix. 2021-02-20 13:28:15 -08:00
Adrian Hesketh 68b5c49fcb Add https://github.com/a-h/min to the examples 2021-02-20 13:27:38 -08:00
Garrett D'Amore 16556370d7 Support for new Suspend and Resume API.
fixes #194 Starting multiple screen sessions (lost key event)

You can test this by using the mouse demo, which now supports pressing
CTRL-Z.  This does not actually suspend the demo, but starts a subshell
which takes over.  After the subshell is exited, the demo takes control
of the screen back.  This can be done multiple times, and it is possible
to start multiple "nested" iterations of the demo this way.
2021-02-20 13:20:58 -08:00
Garrett D'Amore 19e17097d8 Mark PostEventWait deprecated.
At some point in the future this is going to be replaced with
a simpler channel design, and the current blocking approach
is both non-idiomatic, and fragile.  Don't use it.
2021-01-24 16:48:47 -08:00
Garrett D'Amore 13bc6c2778 fixes #420 RFE: Mouse wheel only reporting
This adds optional MouseFlags that can be used to adjust what is
tracked for mouse reporting (leaving the other modes to be handled
by the terminal.)  This should work on all XTerm style terminals,
but on Windows we have no way to be selective here.
2021-01-24 15:18:06 -08:00
Garrett D'Amore f0c15689df Mintty (modern) works now. So remove the caveat. 2021-01-24 13:50:22 -08:00
Garrett D'Amore e9095fe4f1 fixes #394 Screen.Fini does not leave the terminal in a usable state in MacOS
This does sort the main problem of screen.Fini(), but really we
want to use a separate Pause() and Resume() function, because
screen.Fini() is not meant for reuse in this way.

Note that one side effect of this change is that applications which
redirect stdin and stdout and expect us to just use /dev/tty instead
are going to break -- we are now using stdin and stdout like nearly
every other screen oriented application.
2021-01-24 13:26:36 -08:00
Garrett D'Amore f2adc0cca0 fixes #423 Please upgrade mattn/go-runewidth 2021-01-15 22:35:06 -08:00
Travis Whitton 044d3f0490 Added example project uchess 2021-01-15 22:23:14 -08:00
Garrett D'Amore 29bb185874 Backout the change to tview, was incorrect. 2020-12-25 11:46:24 -08:00
Garrett D'Amore d664ce8c2b Remove deprecated examples, add cview. 2020-12-25 11:37:28 -08:00
Zhani Baramidze 49e9e720f7 Added example project gonano 2020-12-25 11:32:17 -08:00
mjarkk 3cc2a8dda5 Add gocui to readme 2020-12-25 11:31:37 -08:00
Ole Bulbuk c7f2b33a4d Fix endless loop
InjectKeyBytes would go into an endless loop for single bytes smaller than a blank.
2020-12-14 15:03:29 -08:00
Garrett D'Amore 7d87d8188c fixes #406 Windows 7 terminal - screen is shifted up one row 2020-11-08 21:26:06 -08:00
nagesh-ibm-power 20750b0d3e Add go 1.15 and power support ppc64le to travis 2020-10-30 10:21:12 -07:00
Garrett D'Amore 768da2b4f2 fixes #403 Recogize more truecolor terminals properly
(This just corrects the README to reflect reality.)
2020-10-29 17:30:53 -07:00
Trevor Slocum 6314995119 Add tutorial
Resolves #163.
2020-10-25 10:12:29 -07:00
Taras 1057d5591e Add another example project
Hopefully worthy of being in this list. termbox-go has similar touch-typing tutor in its examples, maybe tcell should too.
2020-10-19 07:26:33 -07:00
Oliver acf90d56d5 Fixed a typo. 2020-10-17 07:12:08 -07:00