This is not supported for Windows or WebAssembly yet.
It's possible for applications to post to the clipboard using
Screen.SetClipboard (any data), and they can retrieve the clipboard
(if permitted) using GetClipboard. The terminal may well reject either
of these.
Retrieval will arrive as a new EventClipboard, if it can. (There is
no good way to make this synchronous.)
This work was inspired by a PR submitted by Consolatis (#562), and
has some work based on it, but it was also substantially improved and
now includes both sides of the clipboard access pattern.
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.
This supports now curly, double, dashed, and dotted underline styles
where trhe terminal supports it. This works well on Windows Terminal,
reasonably on iTerm2, Alacritty, Kitty, and probably others.
The wasm mode terminal includes support for this, dependent on the browser
capabilities.
The macOS Terminal just changes the background color. Legacy Windows
console does nothing.
We will try to provide a regular underscore as a fallback. A new style.go
demo is included to see some style combinations.
This hack will also prevent the clearing of the screen at disengage
time. This may be useful for certain kinds of applications that
want to draw the screen, then place the cursor at a specific location.
(The application will need to do a TGoto on it's own first.)
This fix is not perfect, in that it will not fix every terminal that has
automargin support, but it fixes the *vast* majority of them by eliminating
the hacky workaround for the automargin - essentially using the rmam capability
to disable automatic wrapping at the margin.
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.
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.
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.
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.
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.
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.
This supports both terminfo (Linux, macOS) terminals, and
the legacy Windows console. Perversely, the "modern" Windows
terminal doesn't support application initiated resizing yet.
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.)
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.
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.
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.)
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.