options: Add truecolor to control the usage (#2867)

- `auto`: enable usage of true color if it is supported, otherwise disable it
- `on`: force usage of true color
- `off`: disable true color usage

Co-authored-by: Dmytro Maluka <dmitrymaluka@gmail.com>
This commit is contained in:
Jöran Karl
2025-05-26 18:25:07 +02:00
committed by GitHub
parent bf255b6c35
commit cd0dc9a701
5 changed files with 30 additions and 13 deletions

View File

@@ -47,10 +47,7 @@ color support comes in three flavors.
displaying any colorscheme, but it should be noted that the user-configured
16-color palette is ignored when using true-color mode (this means the
colors while using the terminal emulator will be slightly off). Not all
terminals support true color but at this point most do. True color
support in micro is off by default but can be enabled by setting the
environment variable `MICRO_TRUECOLOR` to 1. In addition your terminal
must support it (usually indicated by setting `$COLORTERM` to `truecolor`).
terminals support true color but at this point most do (see below).
True-color colorschemes in micro typically end with `-tc`, such as
`solarized-tc`, `atom-dark`, `material-tc`, etc... If true color is not
enabled but a true color colorscheme is used, micro will do its best to
@@ -84,11 +81,12 @@ These may vary widely based on the 16 colors selected for your terminal.
### True color
True color requires your terminal to support it. This means that the
environment variable `COLORTERM` should have the value `truecolor`, `24bit`,
or `24-bit`. In addition, to enable true color in micro, the environment
variable `MICRO_TRUECOLOR` must be set to 1. Note that you have to create
and set this variable yourself.
Micro enables true color support by default as long as it detects that the
terminal supports it (which is usually indicated by the environment variable
`COLORTERM` being set to `truecolor`, `24bit` or `24-bit`). You can also force
enabling it unconditionally by setting the option `truecolor` to `on` (or
alternatively by setting the environment variable `MICRO_TRUECOLOR` to 1, which
is supported for backward compatibility).
* `solarized-tc`: this is the solarized colorscheme for true color.
* `atom-dark`: this colorscheme is based off of Atom's "dark" colorscheme.

View File

@@ -462,6 +462,19 @@ Here are the available options:
default value: `false`
* `truecolor`: controls whether micro will use true colors (24-bit colors) when
using a colorscheme with true colors, such as `solarized-tc` or `atom-dark`.
* `auto`: enable usage of true color if micro detects that it is supported by
the terminal, otherwise disable it.
* `on`: force usage of true color even if micro does not detect its support
by the terminal (of course this is not guaranteed to work well unless the
terminal actually supports true color).
* `off`: disable true color usage.
Note: The change will take effect after the next start of `micro`.
default value: `auto`
* `useprimary` (only useful on unix): defines whether or not micro will use the
primary clipboard to copy selections in the background. This does not affect
the normal clipboard using `Ctrl-c` and `Ctrl-v`.