Skip to content

Commit

Permalink
Switch to TOML configuration format
Browse files Browse the repository at this point in the history
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 alacritty#6592.
  • Loading branch information
chrisduerr authored Jun 12, 2023
1 parent ea2c39e commit bd49067
Show file tree
Hide file tree
Showing 38 changed files with 2,103 additions and 1,233 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ insert_final_newline = true
indent_style = space
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
run: |
scdoc < extra/man/alacritty.1.scd | gzip -c > "./alacritty.1.gz"
scdoc < extra/man/alacritty-msg.1.scd | gzip -c > "./alacritty-msg.1.gz"
scdoc < extra/man/alacritty.5.scd | gzip -c > "./alacritty.5.gz"
scdoc < extra/man/alacritty-bindings.5.scd | gzip -c > "./alacritty-bindings.5.gz"
- name: Upload Assets
run: |
mv ./extra/logo/alacritty-term.svg ./Alacritty.svg
Expand All @@ -87,4 +89,3 @@ jobs:
./.github/workflows/upload_asset.sh ./extra/completions/_alacritty $GITHUB_TOKEN
./.github/workflows/upload_asset.sh ./extra/linux/Alacritty.desktop $GITHUB_TOKEN
./.github/workflows/upload_asset.sh ./extra/alacritty.info $GITHUB_TOKEN
./.github/workflows/upload_asset.sh ./alacritty.yml $GITHUB_TOKEN
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,32 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Minimum Rust version has been bumped to 1.65.0
- Manpages are now generated using `scdoc` (see `INSTALL.md`)

### Added

- Warnings for unused configuration file options

### Changed

- Mode-specific bindings can now be bound in any mode for easier macros
- `--help` output is more compact now and uses more neutral palette
- Configuration file now uses TOML instead of YAML
Run `alacritty migrate` to automatically convert all configuration files
- Deprecated config option `draw_bold_text_with_bright_colors`, use
`colors.draw_bold_text_with_bright_colors`
- Deprecated config option `key_bindings`, use `keyboard.bindings`
- Deprecated config option `mouse_bindings`, use `mouse.bindings`

### Fixed

- Hyperlink preview not being shown when the terminal has exactly 2 lines
- Crash on Windows when changing display scale factor

### Removed

- Config option `background_opacity`, use `window.background_opacity`
- Config option `colors.search.bar`, use `colors.footer_bar` instead
- Config option `mouse.url`, use the `hints` config section

## 0.12.1

### Fixed
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ Latency is another important factor for Alacritty. On X11, Windows, and macOS th
Code should be documented where appropriate. The existing code can be used as a guidance here and
the general `rustfmt` rules can be followed for formatting.

If any change has been made to the `config.rs` file, these changes should also be documented in the
example configuration file `alacritty.yml`.
If any change has been made to the `config.rs` file, it should also be documented in the man pages.

Changes compared to the latest Alacritty release which have a direct effect on the user (opposed to
things like code refactorings or documentation/tests) additionally need to be documented in the
Expand Down
34 changes: 31 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ Installing the manual page requires the additional dependencies `gzip` and `scdo
sudo mkdir -p /usr/local/share/man/man1
scdoc < extra/man/alacritty.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty.1.gz > /dev/null
scdoc < extra/man/alacritty-msg.1.scd | gzip -c | sudo tee /usr/local/share/man/man1/alacritty-msg.1.gz > /dev/null
scdoc < extra/man/alacritty.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty.5.gz > /dev/null
scdoc < extra/man/alacritty-bindings.5.scd | gzip -c | sudo tee /usr/local/share/man/man5/alacritty-bindings.5.gz > /dev/null
```

### Shell completions
Expand Down
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ ASSETS_DIR = extra
RELEASE_DIR = target/release
MANPAGE = $(ASSETS_DIR)/man/alacritty.1.scd
MANPAGE-MSG = $(ASSETS_DIR)/man/alacritty-msg.1.scd
CONFIGFILE = alacritty.yml
MANPAGE-CONFIG = $(ASSETS_DIR)/man/alacritty.5.scd
MANPAGE-CONFIG-BINDINGS = $(ASSETS_DIR)/man/alacritty-bindings.5.scd
TERMINFO = $(ASSETS_DIR)/alacritty.info
COMPLETIONS_DIR = $(ASSETS_DIR)/completions
COMPLETIONS = $(COMPLETIONS_DIR)/_alacritty \
Expand Down Expand Up @@ -48,10 +49,11 @@ $(APP_NAME)-%: $(TARGET)-%
@mkdir -p $(APP_COMPLETIONS_DIR)
@scdoc < $(MANPAGE) | gzip -c > $(APP_EXTRAS_DIR)/alacritty.1.gz
@scdoc < $(MANPAGE-MSG) | gzip -c > $(APP_EXTRAS_DIR)/alacritty-msg.1.gz
@scdoc < $(MANPAGE-CONFIG) | gzip -c > $(APP_EXTRAS_DIR)/alacritty.5.gz
@scdoc < $(MANPAGE-CONFIG-BINDINGS) | gzip -c > $(APP_EXTRAS_DIR)/alacritty-bindings.5.gz
@tic -xe alacritty,alacritty-direct -o $(APP_EXTRAS_DIR) $(TERMINFO)
@cp -fRp $(APP_TEMPLATE) $(APP_DIR)
@cp -fp $(APP_BINARY) $(APP_BINARY_DIR)
@cp -fp $(CONFIGFILE) $(APP_EXTRAS_DIR)/
@cp -fp $(COMPLETIONS) $(APP_COMPLETIONS_DIR)
@touch -r "$(APP_BINARY)" "$(APP_DIR)/$(APP_NAME)"
@codesign --remove-signature "$(APP_DIR)/$(APP_NAME)"
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,25 @@ For everyone else, the detailed instructions to install Alacritty can be found

## Configuration

You can find the default configuration file with documentation for all available
fields on the [GitHub releases page](https://github.com/alacritty/alacritty/releases) for each release.
You can find the documentation for Alacritty's configuration in `man 5
alacritty`, or by looking at [the scdoc file] if you do not have the manpages
installed.

[the scdoc file]: ./extra/man/alacritty.5.scd

Alacritty doesn't create the config file for you, but it looks for one in the
following locations:

1. `$XDG_CONFIG_HOME/alacritty/alacritty.yml`
2. `$XDG_CONFIG_HOME/alacritty.yml`
3. `$HOME/.config/alacritty/alacritty.yml`
4. `$HOME/.alacritty.yml`
1. `$XDG_CONFIG_HOME/alacritty/alacritty.toml`
2. `$XDG_CONFIG_HOME/alacritty.toml`
3. `$HOME/.config/alacritty/alacritty.toml`
4. `$HOME/.alacritty.toml`

### Windows

On Windows, the config file should be located at:

`%APPDATA%\alacritty\alacritty.yml`
`%APPDATA%\alacritty\alacritty.toml`

## Contributing

Expand Down
Loading

0 comments on commit bd49067

Please sign in to comment.