Commit Graph

438 Commits

Author SHA1 Message Date
Garrett D'Amore 15a4f4f1fb fixes #677 PollEvent() returns nil when screen is suspended 2024-02-15 22:25:45 -08:00
Garrett D'Amore b05ee8f998 remove stale comment 2024-02-15 22:11:18 -08:00
Garrett D'Amore cc24c71d4b fixes #682 views/app uses deprecated PostEventWait 2024-02-15 22:02:11 -08:00
Garrett D'Amore c3711de418 fixes #683 views: remove unused contentV member 2024-02-15 22:02:01 -08:00
Garrett D'Amore 0393f5eb0b Add security policy. 2024-01-20 17:19:54 -08:00
stk 96e2990564 Don't set modifiers for AltGr on Windows
AltGr is the same as ctrl+alt, and we don't want those to be set when you press
a key using AltGr.
2024-01-03 10:06:01 -08:00
Garrett D'Amore 337e381927 fixes #606 Want ColorNone to preserve existing color(s)
While here, consolidate the use of the Fill() function from
CellBuffer (eliminating redundant code).
2023-12-08 00:19:52 -08:00
Garrett D'Amore 8041b8e7ac Refactor event polling code.
This centralizes much of the logic (hopefully reducing duplication)
for polling events and the queue.  This will make it easier to make
further design changes to express a better, simpler, API to consumers.

While here addressed missing logic to handle Fini correctly on Windows.
2023-12-07 22:55:17 -08:00
Garrett D'Amore e3a99dde75 Add shebang 2023-12-05 14:29:12 -08:00
Garrett D'Amore 26f328fb89 simscreen: unbreak the API
The API for NewSimulationScreen() was changed, which turned out to
break 3rd party libraries and applications.  (We didn't forgot that
this is part of the public API for tcell.)
2023-12-05 14:21:05 -08:00
Garrett D'Amore fb3659df9f refactoring: use common LockRegion implementation 2023-12-04 07:48:27 -08:00
Garrett D'Amore 92c4f488a6 mouse demo: fix crash when multiple buttons pressed together
If we cannot decode the buttons in a drag, we might try to use '*',
which would reuslt in a negative index in the theme table.  This
only affected the demo application itself.
2023-12-03 17:42:09 -08:00
Garrett D'Amore d82c270755 More refactoring, common cell buffer 2023-12-03 17:36:26 -08:00
Garrett D'Amore 602a4730ac Update SimScreen with new refactoring 2023-12-03 17:08:48 -08:00
Garrett D'Amore ef4f9ccd96 Start of base screen refactoring.
A lot of functionality is duplicated across screen implementations,
and adding convenience methods is onerous because one needs to touch
each implementation with what is mostly copy-paste coding.

This represents the start of refactoring to eliminate redundant code
from each implemenation and provide for it in a common layer.
2023-12-03 16:54:28 -08:00
dependabot[bot] fe52739ee8
Bump github.com/mattn/go-runewidth from 0.0.14 to 0.0.15 (#632)
Bumps [github.com/mattn/go-runewidth](https://github.com/mattn/go-runewidth) from 0.0.14 to 0.0.15.
- [Commits](https://github.com/mattn/go-runewidth/compare/v0.0.14...v0.0.15)

---
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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 15:53:12 -08:00
dependabot[bot] 776ecfbd6a
Bump actions/checkout from 3 to 4 (#635)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

---
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>
2023-12-03 15:52:35 -08:00
dependabot[bot] a94f73f8d9
Bump golang.org/x/term from 0.9.0 to 0.15.0 (#661)
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.9.0 to 0.15.0.
- [Commits](https://github.com/golang/term/compare/v0.9.0...v0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 15:51:33 -08:00
dependabot[bot] 5ed7b912b0
Bump golang.org/x/sys from 0.11.0 to 0.15.0 (#660)
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.11.0 to 0.15.0.
- [Commits](https://github.com/golang/sys/compare/v0.11.0...v0.15.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 15:45:16 -08:00
dependabot[bot] 9e2e43bd34
Bump golang.org/x/text from 0.12.0 to 0.14.0 (#648)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.12.0 to 0.14.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.12.0...v0.14.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>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-03 15:41:46 -08:00
Tim Culverhouse 20b65d615f
Fix dynamic terminfo when an alias is used (#639)
Co-authored-by: Garrett D'Amore <garrett@damore.org>
2023-12-03 15:40:31 -08:00
Garrett D'Amore 2917c3801e fixes #647 Screen.Clear — Flickering on Windows 2023-12-03 13:50:52 -08:00
Garrett D'Amore 50882fce9f Update console_win.go 2023-12-03 12:10:55 -08:00
Junegunn Choi b4e2d68113 Implement missing methods in cScreen 2023-12-03 12:10:55 -08:00
Garrett D'Amore 168f47f0f7 fixes #623 Cursor style is not reset when closing 2023-12-03 12:04:00 -08:00
Baris Balli 8a50441ee1 project added to the ed 2023-10-31 15:40:54 -07:00
Baris Balli 7d4a088d8c Readme updated, an example project [hero.go] added 2023-10-31 15:40:54 -07:00
Chris 08c7757cd1 Update color.go 2023-08-26 23:04:10 -07:00
Chris 61f49ebde1 Update color.go 2023-08-26 23:04:10 -07:00
Chris e1cc2cb21f add stringable util methods 2023-08-26 23:04:10 -07:00
Tim Culverhouse 83e6762660 demos: add sixel demo
Add a demo of sixel drawing
2023-08-15 06:57:42 -07:00
Tim Culverhouse c5c66b8427 tty: modify WindowSize method to return windowsize object
Modify the WindowSize method of the Tty interface to return a WindowSize
object. This object includes the window size in pixels, for use in
direct drawing of sixels. Terminals that do not support this feature
will have pixel sizes of 0,0.
2023-08-15 06:57:42 -07:00
Tim Culverhouse bfc5242f05 EventResize: use WindowSize struct internally
Introduce a WindowSize type and use it internally for the EventResize
event. Add PixelSize method to EventResize to report the screen size in
pixels, if supported.
2023-08-15 06:57:42 -07:00
Tim Culverhouse fa6cd3ec5b screen: extend interface with Tty method
Extend the Screen interface with a new Tty method, which returns the
underlying tty when the screen is a terminal. This enables direct
drawing to the Tty.

Implement the interface for the three screen implementatinos included in
the library.
2023-08-15 06:57:42 -07:00
Tim Culverhouse ae2c4a8044 screen: extend interface with LockRegion method
Extend the Screen interface with a new LockRegion method. This method
sets or unsets a lock on a region of cells. This will be used in
subsequent commits to enable direct drawing to the underlying TTY. The
locks are necessary in order to prevent cells from being drawn on top of
a directly drawn cell.

Implement this interface for the three screen implementations included
in the library.
2023-08-15 06:57:42 -07:00
Tim Culverhouse 894250edb7 cellbuffer: add ability to lock cells
Add a lock to individual cells. A lock on a cell will prevent it from
being redrawn by reporting it as clean. This will be true until the lock
has been removed. When a lock is removed, the cell is also marked as
dirty in order to force a redraw.
2023-08-15 06:57:42 -07:00
dependabot[bot] c1028277e6 Bump golang.org/x/sys from 0.9.0 to 0.11.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.9.0 to 0.11.0.
- [Commits](https://github.com/golang/sys/compare/v0.9.0...v0.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 23:05:22 -07:00
dependabot[bot] 0e7e5ff245 Bump golang.org/x/text from 0.7.0 to 0.12.0
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.7.0 to 0.12.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.7.0...v0.12.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>
2023-08-14 18:51:06 -07:00
Garrett D'Amore b09ad8741e wasm: implement focus events for wasm terminal 2023-08-14 18:42:16 -07:00
Garrett D'Amore 8b8ed1d164 go fmt compliance fixes 2023-08-14 18:36:19 -07:00
Remko Tronçon b187e6250e Add LookupTerminfo stub for wasm
Resolves #617
2023-08-14 17:11:51 -07:00
dependabot[bot] b64f3de22e Bump golang.org/x/term from 0.5.0 to 0.9.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.5.0 to 0.9.0.
- [Commits](https://github.com/golang/term/compare/v0.5.0...v0.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-14 17:09:20 -07:00
stk 42b3beb245 fixup! Make focus reporting an opt-in feature, like mouse reporting 2023-08-14 17:07:05 -07:00
stk f028121cb8 Make focus reporting an opt-in feature, like mouse reporting 2023-08-14 17:07:05 -07:00
stk 622b6c2aa7 Enable focus reporting only for terminals that support it
We assume that any terminal that supports mouse reporting will also support
focus reporting; but we also add an entry to Terminfo to let specific terminals
override it if needed.
2023-08-14 17:07:05 -07:00
stk 85dc29bf8a Implement focus events 2023-08-14 17:07:05 -07:00
Matthew Roseman a92c043b0b simplified bitwise math to determine if mouse scrolling 2023-08-14 17:05:00 -07:00
Matthew Roseman b9a2bbda10 don't record buttondn on scroll events 2023-08-14 17:05:00 -07:00
dependabot[bot] c14349d151 Bump codecov/codecov-action from 3.1.1 to 3.1.4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.4.
- [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.1...v3.1.4)

---
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>
2023-08-14 17:04:44 -07:00
delthas 709868d93d Support Xterm modifier keys for dynamic terminfos
Previously, modified function keys in dyanmic terminals were not
supported (like shift/control/alt + arrow keys).

Even though xterm-compatible terminals were dynamically discovered
and their keys added to the terminfo struct, the Modifiers field
was not supported and therefore the modified Xterm keys were not
added to the keycodes map (prepareXtermModifiers was skipped).

This fixes the issue by setting the Modifiers field when we
discover that the terminal is xterm-compatible.
2023-08-14 17:04:00 -07:00