aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
AgeCommit message (Collapse)Author
2017-01-05Allow key_binding have spacequininer kel
2017-01-02Have default mouse and key bindingsJoe Wilm
This improves the situation where the user has not installed the default configuration file. Resolves #42.
2017-01-02Real support for placing config in XDG_CONFIG_HOMEJoe Wilm
Resolves #35.
2017-01-02Rework font loadingJoe Wilm
This work started because we wanted to be able to simply say "monospace" on Linux and have it give us some sort of font. The config format for fonts changed to accomodate this new paradigm. As a result, italic and bold can have different families from the normal (roman) face. The fontconfig based font resolution probably works a lot better than the CoreText version at this point. With CoreText, we simply iterate over fonts and check it they match the requested properties. What's worse is that the CoreText version requires a valid family. With fontconfig, it will just provide the closest matching thing and use it (unless a specific style is requested).
2016-12-26Implement copying selection for macOSJoe Wilm
Still need automatic loading into selection copy buffer for linux.
2016-12-26Refactor bindings and fix binding testsJoe Wilm
The somewhat redundant KeyBinding and MouseBinding types were removed in favor of a Binding<T> type. This allows all binding code to be reused for both scenarios. The binding tests were fixed by only asserting on `is_triggered_by()` instead of checking that the action escape sequence was delivered properly.
2016-12-16Misc formatting fixesJoe Wilm
2016-12-16Rustup and clippyJoe Wilm
All of the changes in this commit are due to clippy lints.
2016-12-11Finish main.rs cleanupJoe Wilm
* config::Monitor is more ergonomic and self-contained * Fixed an issue with macOS resize. Previously, the terminal was marked as dirty in the window resize handler, but the display can't do that. Instead, the event processor returns a flag whether it was requested to wakeup.
2016-12-11Move config path into Config typeJoe Wilm
This cleans up the Config::load API significantly. Several miscellaneous comments were also added.
2016-12-11Refactor color list managementJoe Wilm
There's now a ColorList type that provides strongly typed indexing for not only usize but NamedColor as well. Previously, the `NamedColor` was casted to a `usize` when indexing the colors. Additionally, only one copy of the ColorList needs to exist;it's borrowed from the `Config` when rendering, and the renderer doesn't need a copy.
2016-12-11Add support for indexed colorsJoe Wilm
ANSI escape sequences like `\x1b[48;5;10m` were not supported until now. Specifically, the second attribute, 5, says that the following attribute is a color index. The ref tests were updated since `enum Color` variants changed.
2016-11-19Fix mouse bindingsJoe Wilm
Config expected key and the default config file had the wrong section.
2016-11-19Add support for recording/running ref testsJoe Wilm
Ref tests use a recording of the terminal protocol and a serialization of the grid state to check that the parsing and action handling systems produce the correct result. Ref tests may be recorded by running alacritty with `--ref-test` and closing the terminal by using the window "X" button. At that point, the recording is fully written to disk, and a serialization of important state is recorded. Those files should be moved to an appropriate folder in the `tests/ref/` tree, and the `ref_test!` macro invocation should be updated accordingly. A couple of changes were necessary to make this work: * Ref tests shouldn't create a pty; the pty was refactored out of the `Term` type. * Repeatable lines/cols were needed; on startup, the terminal is resized * by default to 80x24 though that may be changed by passing `--dimensions w h`. * Calculating window size based on desired rows/columns and font metrics required making load_font callable multiple times. * Refactor types into library crate so they may be imported in an integration test. * A whole bunch of types needed symmetric serialization and deserialization. Mostly this was just adding derives, but the custom deserialization of Rgb had to change to a deserialize_with function. This initially adds one ref test as a sanity check, and more will be added in subsequent commits. This initial ref tests just starts the terminal and runs `ll`.
2016-11-17Make bindings configurable from alacritty.ymlJoe Wilm
Bindings were previously hardcoded within input.rs; adding, removing, or changing a binding required a recompile! Now, bindings may be declared in alacritty.yml. Even better, bindings are live-reloaded when alacritty.yml is changed! One unexpected benefit of this change was that all of the special casing in input.rs has disappeared. Conversely, config.rs has gained complexity for all of the deserialization logic. Resolves #3.
2016-11-11Fix config file reloading on macOSJoe Wilm
2016-10-28Support drawing bold test with bright colorsJoe Wilm
This feature is on by default
2016-10-27Move config reloading to separate threadJoe Wilm
This feature was previously shoved into the renderer due to initial proof of concept. Now, providing config updates to other systems is possible. This will be especially important for key bindings!
2016-10-23Proof of concept live reloading for colorsJoe Wilm
The architecture here is really poor. Need to move file watching into a dedicated location and probably have an spmc broadcast queue. other modules besides rendering will care about config reloading in the future.
2016-10-15Make colors configurable from fileJoe Wilm
Added solarized dark color scheme for testing purposes. Resolves #1.
2016-10-14Rustup and update dependenciesJoe Wilm
Now uses serde_dervive \o/
2016-08-12Support bold/italic font rendering on macOSJoe Wilm
This patch adds support for rendering italic fonts and bold fonts. The `font` crate has a couple of new paradigms to support this: font keys and glyph keys. `FontKey` is a lightweight (4 byte) identifier for a font loaded out of the rasterizer. This replaces `FontDesc` for rasterizing glyphs from a loaded font. `FontDesc` had the problem that it contained two strings, and the glyph cache needs to store a copy of the font key for every loaded glyph. `GlyphKey` is now passed to the glyph rasterization method instead of a simple `char`. `GlyphKey` contains information including font, size, and the character. The rasterizer APIs do not define what happens when loading the same font from a `FontDesc` more than once. It is assumed that the application will track the resulting `FontKey` instead of asking the font to be loaded multiple times.
2016-06-30Add config fileJoe Wilm
Configuration may now be specified in either `$HOME/.alacritty.yml` or `$HOME/.config/alacritty.yml`. See `alacritty.yml` in the repository root for an example. When a configuration file cannot be located, a default configuration is used.