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.
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.
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.)
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.
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.
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().
This causes colors that are set that are low numbered to
be treated as themed colors -- basically honoring the palette
of the terminal.
The Style and Color implementations have changed quite a bit
to permit growth -- the colors are now 64-bits wide to permit
using the upper bits as flags, and to leave room for a future
alpha channel.
There is a new TrueColor() method on colors that obtains the
value as strict RGB value, and this will be used in lieu of
whatever terminal colors are provided -- giving the application
full control over the color space if they want, without
forcibly clobbering user preferences for terminals for the
vast majority of cases.
Indexed colors are created with the new PaletteColor 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
This expands support for 24-bit color for terminals that support the
ISO 8613-6:1994 escape sequences (same as xterm), allowing this support
to be enabled by setting % COLORTERM to "truecolor" (or 24bit or 24-bit),
or by setting TCELL_TRUECOLOR to "on", or by setting $TERM a value that
ends in the word "-truecolor".
As this is handled by the runtime now, we no longer need to create magical
database entries for -truecolor options.
A colors.go demo is provided to show off 24-bit color support.
fixes#38 Broke wide characters in last update
fixes#39 Clean up logic for encodings, enhance fallback options
fixes#36 Support more mouse buttons on Windows.