| 1 |
== Breaking Changes in _Tcell_ v2 |
| 2 |
|
| 3 |
A number of changes were made to _Tcell_ for version two, and some of these |
| 4 |
are breaking. |
| 5 |
|
| 6 |
=== Import Path |
| 7 |
The import path for tcell has changed to github.com/gdamore/v2 to reflect a new major version. |
| 8 |
|
| 9 |
=== Style Is Not Numeric |
| 10 |
The type `Style` has changed to a structure, to allow us to add additional data such as flags for color setting, more attribute bits, and so forth. |
| 11 |
Applications that relied on being a number will need to be updated to use the accessor methods. |
| 12 |
|
| 13 |
=== Mouse Event Changes |
| 14 |
The middle mouse button was reported as button 2 on Linux, but as button 3 on Windows, |
| 15 |
and the right mouse button was reported the reverse way. |
| 16 |
_Tcell_ now always reports the right mouse button as button 2, and the middle button as button 3. |
| 17 |
To help make this clearer, new symbols `ButtonPrimary`, `ButtonSecondary`, and |
| 18 |
`ButtonMiddle` are provided. |
| 19 |
(Note that which button is right vs. left may be impacted by user preferences. |
| 20 |
Usually the left button will be considered the Primary, and the right will be the Secondary.) |
| 21 |
Applications may need to adjust their handling of mouse buttons 2 and 3 accordingly. |
| 22 |
|
| 23 |
=== Terminals Removed |
| 24 |
A number of terminals have been removed. |
| 25 |
These are mostly ancient definitions unlikey to be used by anyone, such as `adm3a`. |
| 26 |
|
| 27 |
=== High Number Function Keys |
| 28 |
|
| 29 |
Historically terminfo reported function keys with modifiers set as a different |
| 30 |
function key altogether. For example, Shift-F1 was reported as F13 on xterm. |
| 31 |
_Tcell_ now prefers to report these using the base key (such as F1) with modifiers added. |
| 32 |
This works on xterm and VTE based emulators, but some emulators may not support this. |
| 33 |
The new behavior more closely aligns with behavior on Windows platforms. |
| 34 |
|
| 35 |
== New Features in _Tcell_ v2 |
| 36 |
|
| 37 |
These features are not breaking, but are introduced in version 2. |
| 38 |
|
| 39 |
=== Improved Modifier Support |
| 40 |
|
| 41 |
For terminals that appear to behave like the venerable XTerm, _tcell_ |
| 42 |
automatically adds modifier reporting for ALT, CTRL, SHIFT, and META keys |
| 43 |
when the terminal reports them. |
| 44 |
|
| 45 |
=== Better Support for Palettes (Themes) |
| 46 |
|
| 47 |
When using a color by its name or palette entry, _Tcell_ now tries to |
| 48 |
use that palette entry as is; this should avoid some inconsistency and undesirable |
| 49 |
overriding of colors where colors would override settings made in the terminal. |
| 50 |
|
| 51 |
When true fidelity to RGB values is needed, the new `TrueColor()` API can be used |
| 52 |
to create a color that is precisely the direct color, which bypasses the palette |
| 53 |
altogether. |
| 54 |
|
| 55 |
=== Automatic TrueColor Detection |
| 56 |
|
| 57 |
For some terminals, if the `Tc` or `RGB` properties are present in terminfo, |
| 58 |
_Tcell_ will automatically assume the terminal supports 24-bit color. |
| 59 |
|
| 60 |
=== ColorReset |
| 61 |
|
| 62 |
A new color value, `ColorReset` can be used on the foreground or the background |
| 63 |
to reset the color the default used by the terminal. |
| 64 |
|
| 65 |
=== tmux Support |
| 66 |
|
| 67 |
_Tcell_ now has improved support for tmux, when the `$TERM` variable is set to "tmux". |
| 68 |
|
| 69 |
=== Strikethrough Support |
| 70 |
|
| 71 |
_Tcell_ has support for strikethrough when the terminal supports it, using the new `StrikeThrough()` API. |