This switches Alacritty's default configuration format from yaml to
toml. While yaml is still supported, it is done by converting it to toml
and should be removed entirely in the future.
All existing features were persisted based on my testing. Behavior
should not change much, though `--option` might have slightly different
behavior since the entire line is not interpreted as one line of toml.
A new `alacritty migrate` subcommand has been added which allows
automatic migration from yaml to toml. This also could be used as a
facility to automatically fix configuration file changes in the future.
Closes#6592.
The glutin 0.30.0 update decouples glutin from winit which
provides us with basis for a multithreaded renderer. This
also improves robustness of our configuration picking,
context creation, and surface handling.
As an example we're now able to start on systems without a vsync,
we don't try to build lots of contexts to check if some config works,
and so on.
That also brings us possibility to handle context losses, but that's
a future work.
Fixes#1268.
This patch adds a new mechanism for changing configuration options
without editing the configuration file, by sending options to running
instances through `alacritty msg`.
Each window will load Alacritty's configuration file by default and then
accept IPC messages for config updates using the `alacritty msg config`
subcommand. By default all windows will be updated, individual windows
can be addressed using `alacritty msg config --window-id
"$ALACRITTY_WINDOW_ID"`.
Each option will replace the config's current value and cannot be reset
until Alacritty is restarted or the option is overwritten with a new
value.
Configuration options are passed in the format `field.subfield=value`,
where `value` is interpreted as yaml.
Closes#472.
This replaces the existing `Deserialize` derive from serde with a
`ConfigDeserialize` derive. The goal of this new proc macro is to allow
a more error-friendly deserialization for the Alacritty configuration
file without having to manage a lot of boilerplate code inside the
configuration modules.
The first part of the derive macro is for struct deserialization. This
takes structs which have `Default` implemented and will only replace
fields which can be successfully deserialized. Otherwise the `log` crate
is used for printing errors. Since this deserialization takes the
default value from the struct instead of the value, it removes the
necessity for creating new types just to implement `Default` on them for
deserialization.
Additionally, the struct deserialization also checks for `Option` values
and makes sure that explicitly specifying `none` as text literal is
allowed for all options.
The other part of the derive macro is responsible for deserializing
enums. While only enums with Unit variants are supported, it will
automatically implement a deserializer for these enums which accepts any
form of capitalization.
Since this custom derive prevents us from using serde's attributes on
fields, some of the attributes have been reimplemented for
`ConfigDeserialize`. These include `#[config(flatten)]`,
`#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute
is currently limited to at most one per struct.
Additionally the `#[config(deprecated = "optional message")]` attribute
allows easily defining uniform deprecation messages for fields on
structs.