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

363 Commits

Author SHA1 Message Date
Garrett D'Amore
0fb7c000c5 Fix status badges (broken by shields.io) v2.5.4 2022-12-31 09:12:50 -08:00
Garrett D'Amore
dc01b79c87 fixes #580 tcell custom tty on Windows will not work
Applications will need to supply a working TTY of course.
2022-12-30 15:43:36 -08:00
Garrett D'Amore
2f889d79bd Make RUNEWIDTH_EASTASIAN=0 the default.
fixes #578

Also, while here, create a look up table
for performance reasons.  This can be suppressed by a new
TCELL_MINIMIZE environment variable, if RAM is precious.

Tcell applications should work out of the box by default
for most users in East Asian locales now.
2022-12-30 15:34:58 -08:00
Garrett D'Amore
a642547922 fixes #576 Intermittent screen flashes 2022-12-30 14:55:11 -08:00
Garrett D'Amore
44c298f729 Encoding package should initialize at import.
There is no reason to make callers execute Register().
Also, while here, let's add some test cases.
2022-12-30 13:30:58 -08:00
Garrett D'Amore
916a717ae8 Add example case for registering encodings.
fixes #583
2022-12-30 12:54:50 -08:00
Garrett D'Amore
e6d83cf4c3 Import order fix. 2022-12-18 18:58:04 +00:00
Garrett D'Amore
85d85c15ba Minor comment fixups. 2022-12-17 09:16:24 -08:00
dependabot[bot]
ce3f911d83 Bump golang.org/x/text from 0.4.0 to 0.5.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.4.0...v0.5.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 15:13:48 -08:00
Sergio de Mingo
68adf4676d update README with gbb repo link 2022-10-30 18:33:51 -07:00
Garrett D'Amore
960cacdea6 Fix language selectors. 2022-10-25 19:19:31 -07:00
Eric S. Raymond
3e6ca93679 Improve tutorial program to show how to catch and re-raise a panic.
Some other clarifications added as well.

Co-authored-by: Garrett D'Amore <garrett@damore.org>
2022-10-20 09:40:48 -07:00
Garrett D'Amore
d3cbfcfb7a fixes #574 Mouse wheel events during click-drag misdelivered as button events 2022-10-18 18:13:50 -07:00
Tim Culverhouse
ede1dd5ee6 hyperlinks: fix id escape format
Commit 43efca775e73 added support for url IDs within OSC8 escape
sequences, however the formatting of the param is incorrect.

Use `id=` instead of `id:`

Fixes: 43efca775e73 ("hyperlinks: add support for optional id parameter")
2022-10-17 15:40:06 -07:00
dependabot[bot]
3aa9ffce5d Bump golang.org/x/text from 0.3.7 to 0.4.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.3.7 to 0.4.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.3.7...v0.4.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 15:38:55 -07:00
Garrett D'Amore
7557ac2a6c fixes #564 Excessive Ram usage for colors in direct / Tc mode 2022-10-16 22:39:04 -07:00
Chris Bradbury
178ac4393a Enable paste support in views.Application
Pasting is not supported when using the `Application` view. This commit enables pasting support on an opt-in basis.

Fixes #552
2022-10-16 22:32:30 -07:00
Tim Culverhouse
43efca775e hyperlinks: add support for optional id parameter
OSC8 escape sequences allow for marking up hyperlinks in the terminal.
An optional `id` parameter is defined to allow applications to signal to
the terminal that (potentially) broken character sequences belong to the
same URL and should be treated as if they were connected.

Add support for optional id parameters, set by the application. Update
test case for ti.EnterUrl.

Fixes: https://github.com/gdamore/tcell/issues/568
Reference: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#hover-underlining-and-the-id-parameter
2022-10-16 22:31:33 -07:00
Tim Culverhouse
dbd182b6da widgets: lock access to WidgetWatchers internal map
The WidgetWatchers struct is designed to be embedded into custom widgets
in order to satisfy the WidgetWatcher interface. The implementation uses
an internal map for storing EventHandlers, but does not lock access to
the access of the map within each method. A race condition can occur if
Watch, Unwatch, or any event is Posted from separate goroutines.

Lock access to the internal map. When posting an event, create a deep
copy of the map for iterating. This prevents potential deadlocks from a
widget calling Unwatch while handling an event.
2022-10-16 22:31:04 -07:00
dependabot[bot]
b9dc8a651a Bump github.com/mattn/go-runewidth from 0.0.13 to 0.0.14
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.13 to 0.0.14.
- [Release notes](https://github.com/mattn/go-runewidth/releases)
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.13...v0.0.14)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-runewidth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-15 08:56:39 -07:00
dependabot[bot]
d8866de450 Bump codecov/codecov-action from 3.1.0 to 3.1.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-15 08:56:08 -07:00
Chris Bradbury
96bb70f9ef
Invert comparison operators in CellView.Size() (#554)
Fixes #553

This function is supposed to return a minimum 2x2 square. However, as the comparison operators are the wrong way around a maximum 2x2 square is returned instead. Inverting the comparison operators fixes the issue.
2022-09-11 13:20:27 -07:00
Chris Bradbury
eef35d4cfc
Remove redundant 'equal to' comparison in ViewPort.ValidateView methods. (#557)
The 'equal to' comparisons in the `ViewPort.ValidateViewX()` and `ViewPort.ValidateViewY()` methods are not required as the `ViewPort`s corresponding `view` attributes will be set equal to the right operand if the conditional resolves as true. The current behaviour results in the `view` attributes being set unnecessarily if it already equals the limit.
2022-09-11 13:16:51 -07:00
Garrett D'Amore
a8322bf143 Use /v2 for the report card. 2022-08-31 11:43:45 -07:00
Garrett D'Amore
fbfecdf1f8 fix spelling 2022-08-31 11:40:43 -07:00
Garrett D'Amore
d25117a2e5 Go fmt for the project. 2022-08-31 11:37:42 -07:00
Garrett D'Amore
3f5bfde5ba fix coverage 2022-08-31 11:20:37 -07:00
Garrett D'Amore
cd95e39380
Add support for coverage. (#550) 2022-08-31 11:09:04 -07:00
Garrett D'Amore
9b8e158cef fixes #546 terminfo tput escape sequence errors
These fix errors discovered while implementing the same logic
in dcell.  While here, the conditional support was simplified
using a similar approach as used in dcell, and test cases were
added.
2022-08-31 10:50:34 -07:00
No-one-important
bd74010edc
add goreportcard (#530) 2022-08-30 12:12:27 -07:00
Zaim Bakar
e5a59254fc
fixes #543 Horizontal, Vertical should have type Orientation (#544) 2022-08-30 12:08:59 -07:00
Garrett D'Amore
46afc5218a minor markup fixes v2.5.3 2022-08-20 08:51:58 -07:00
Garrett D'Amore
2faa178e3c Replace Ukraine banner with a badge. 2022-08-20 08:50:19 -07:00
Garrett D'Amore
896efabe24 Better handling for monochrome.
We will automatically select an inverse video mode if we cannot
find any colors at all.  This should help some fallbacks.
v2.5.2
2022-07-29 20:02:51 -07:00
Garrett D'Amore
e15e96cbca Add banner in support of Ukraine. 2022-04-23 11:02:11 -07:00
Garrett D'Amore
80a58b9089 fixes #462 Console resizing
This supports both terminfo (Linux, macOS) terminals, and
the legacy Windows console.  Perversely, the "modern" Windows
terminal doesn't support application initiated resizing yet.
2022-04-23 09:50:07 -07:00
Garrett D'Amore
22d7226321 Show modifiers with mouse buttons in demo. 2022-04-16 20:27:20 -07:00
Garrett D'Amore
e7b14a71dc fixes #300 Implement terminal hyperlinks
fixes #526 tcell emits redundant attributes

This work is inspired by, and partly derived from, work submitted by
Simon Ser (@emersion).  However, we've modified the bottom half of
the terminfo parser to better support strings properly, and are using
proper terminfo syntax.

Instead of an attribute called Hyperlink, we have called it Url
for the sake of brevity.

While here we noticed and fixed bug #526, which could badly impact slow
terminals, or slow links. This likely makes things better for folks
coming over long distance SSH connections for example.

We've also provided OSC 8 handling for all terminals which appear to
support the mouse sequences; hopefully ones that don't handle this
sensibly will just ignore it.  (Limited testing seems to show this.)
2022-04-16 10:57:21 -07:00
Garrett D'Amore
cb7cb02d04 Include some explanatory text for the cursor demo. 2022-04-16 10:57:21 -07:00
Garrett D'Amore
f631374ce3 Some minor language fixups. 2022-04-16 08:27:02 -07:00
Tobias Sjösten
6d3490a3ee
Fix doc typo (#525) 2022-04-16 08:22:12 -07:00
Will Daly
1510fff44d
Send AttrOff when clearing the screen (#523)
In tcell v2.4, the following calls would reset the screen
to its default color:

1. SetContent() to change the bg color to maroon.
2. Clear()
3. Show()

In tcell v2.5, the behavior changed to clear the screen
to the last-used style passed to SetContent.

This happens because commit 62f5502f set the dirty flag
to false for all cells, on the assumption that sending
ti.Clear would clear the cells anyway. Unlike the drawCell
calls triggered by the dirty flag, however, clearScreen
does not send AttrOff. This causes the screen to clear
to the last-used background color.
v2.5.1
2022-04-16 07:58:36 -07:00
Garrett D'Amore
78490bdc53 fixes #509 style disappears v2.5.0 2022-04-03 11:40:07 -07:00
Garrett D'Amore
d699c7e510 fixes #521 tmux-256color missing from bundled terminfo 2022-04-02 14:50:25 -07:00
Juan Maia
1f27c5e1ea
Upate golang.org/x/sys version to fix bug on darwin with go 1.18 (#520) 2022-04-02 14:43:57 -07:00
MATSUDA Takashi
2a1a1b5864
enhanced mouse tracking mode (1006) is set improperly when exiting tcell (#512) 2022-03-13 13:30:54 -07:00
dependabot[bot]
fba1334b37
Bump actions/setup-go from 2.1.5 to 3 (#516)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v2.1.5...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-13 13:28:47 -07:00
dependabot[bot]
f94c6b2ed1
Bump actions/checkout from 2.4.0 to 3 (#517)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2.4.0 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2.4.0...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-13 13:28:25 -07:00
Garrett D'Amore
8b074c48d6 Add note for Russian people with respect to invasion of Ukraine. 2022-03-04 18:15:09 -08:00
anmitsu
0d961d2608
Add examples in README.md (#504) 2022-02-08 07:34:40 -08:00