Commit Graph

31 Commits

Author SHA1 Message Date
Garrett D'Amore c9ba0cf327 fixes #710 Add support for setting the window title 2024-03-09 10:05:58 -08:00
Garrett D'Amore 887cf2766e fixes #666 cursor color
This adds a new optional parameter to screen.SetCursorStyle,
which is a color.  The cursors demo is enhanced to show this.

This ability is supported on screen types, provided the underlying
terminal supports the capability.
2024-03-07 08:32:39 -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 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 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
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
stk f028121cb8 Make focus reporting an opt-in feature, like mouse reporting 2023-08-14 17:07:05 -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 761abf6821 fixes #356 Vim cursors shapes?
This adds a new method, SetCursorStyle() to the screen API.
It also automatically restores the cursor when disengaging to
the default cursor.  Modern terminals (and Windows console) support
this.
2021-09-28 20:05:18 -07:00
eNV25 b60a903b98
Add Screen.ChannelEvents v2 (#465) 2021-06-11 19:43:12 -07:00
Garrett D'Amore 7a0b45cce0 fixes #422 RFE: Handling events in batches 2021-05-16 09:21:17 -07: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 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
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 197faf3eae fixes #120 Support for bracketed paste mode
This adds Bracketed Paste support for terminals that have mouse
support and support it.  The bracketing events are EventPaste,
with methods to note Start() or End() of the paste.  Content
comes in as normal rune events.  Programs must opt-in to this by
calling screen.EnablePaste().
2020-10-15 23:13:03 -07:00
Ben Burwell 8ec73b6fa6 Implement Beep() API
Add a Beep() method to the Screen interface. On *nix systems, this
writes the bell character (0x07) to the tty. On Windows, we call the
MessageBeep syscall.

Fixes: #2
2020-03-15 10:36:32 -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
Joshua T Corbin e07997cdf1 Fix simscreen.SetSize 2017-12-25 02:12:38 -08:00
Jaime Piña 44772c121b Fix small lint & spelling issues 2016-12-06 09:19:16 -08:00
Garrett D'Amore 91d5e748ae fixes #114 Add Fill() method View API
fixes #113 Create SimpleStyledTextBar
2016-05-23 14:55:11 -07:00
Garrett D'Amore 5dc5326c0e fixes #44 Expose some capability info 2016-01-19 15:51:33 -08:00
Garrett D'Amore 43f9cc0d07 fixes #75 Add goreport and fix related issues 2015-11-04 17:05:24 -08:00
Garrett D'Amore e7d14c2863 fixes #62 windows console may have FIFO hang
fixes #63 Initial views API integration
2015-10-30 12:18:06 -07:00
Garrett D'Amore 6939959660 fixes #50 Expose CanDisplay(rune) 2015-10-14 19:46:35 -07:00
Garrett D'Amore 5bef83acf3 fixes #45 Add fallback rune support 2015-10-14 19:09:00 -07:00
Garrett D'Amore 02eef725e2 fixes #35 Inadequate buffering dirty/detection algorithm 2015-10-07 02:35:14 -07:00
Garrett D'Amore 69be119a27 fixes #27 Add a test framework & test code 2015-10-05 23:08:31 -07:00