Commit Graph

27 Commits

Author SHA1 Message Date
Honza Pokorny e98e6bdf64 Add doc string to 'shell' config option 2017-01-07 08:43:09 -04:00
Honza Pokorny ea44427be3 Add "shell" option to config
This allows you to configure the shell to use when alacritty starts.

cc: #122
2017-01-06 22:07:35 -04:00
Joe Wilm 99ef2bef9e Add default macOS config
Should solve the `monospace` issue people are seeing for now.
2017-01-06 11:17:48 -08:00
quininer kel 2befe3681e Write default config when not found 2017-01-06 11:17:33 -08:00
quininer kel 0b157c4e92 Allow key_binding have space 2017-01-05 21:45:46 +08:00
Joe Wilm 1edfef4a32 Have default mouse and key bindings
This improves the situation where the user has not installed the default
configuration file.

Resolves #42.
2017-01-02 20:42:57 -08:00
Joe Wilm a105be82cf Real support for placing config in XDG_CONFIG_HOME
Resolves #35.
2017-01-02 20:05:31 -08:00
Joe Wilm 8630185639 Rework font loading
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).
2017-01-02 19:49:38 -08:00
Joe Wilm ae470bf68b Implement copying selection for macOS
Still need automatic loading into selection copy buffer for linux.
2016-12-26 22:56:19 -05:00
Joe Wilm d28a734473 Refactor bindings and fix binding tests
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-26 19:00:27 -05:00
Joe Wilm bde4dacc79 Misc formatting fixes 2016-12-16 22:48:04 -08:00
Joe Wilm dc918ae71a Rustup and clippy
All of the changes in this commit are due to clippy lints.
2016-12-16 22:13:51 -08:00
Joe Wilm 4df29bb377 Finish main.rs cleanup
* 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-11 20:23:41 -08:00
Joe Wilm 093ac43f80 Move config path into Config type
This cleans up the Config::load API significantly. Several miscellaneous
comments were also added.
2016-12-11 20:23:41 -08:00
Joe Wilm ce32eee099 Refactor color list management
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-11 20:23:41 -08:00
Joe Wilm 23e36f1925 Add support for indexed colors
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-12-11 20:23:41 -08:00
Joe Wilm 88a92982b1 Fix mouse bindings
Config expected key and the default config file had the wrong section.
2016-11-19 21:49:23 -08:00
Joe Wilm 66dbd29cd1 Add support for recording/running ref tests
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-19 21:34:11 -08:00
Joe Wilm d97996e19d Make bindings configurable from alacritty.yml
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-17 17:17:54 -08:00
Joe Wilm 3e0b2b6c58 Fix config file reloading on macOS 2016-11-11 16:53:13 -08:00
Joe Wilm a81152cc43 Support drawing bold test with bright colors
This feature is on by default
2016-10-28 09:19:48 -07:00
Joe Wilm 06ea6c8e56 Move config reloading to separate thread
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-27 10:16:08 -07:00
Joe Wilm 5876b4bf7a Proof of concept live reloading for colors
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-23 15:37:06 -07:00
Joe Wilm d4c1d51e36 Make colors configurable from file
Added solarized dark color scheme for testing purposes.

Resolves #1.
2016-10-15 15:56:27 -07:00
Joe Wilm 71de5501c4 Rustup and update dependencies
Now uses serde_dervive \o/
2016-10-14 16:38:15 -07:00
Joe Wilm b70394170c Support bold/italic font rendering on macOS
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-08-12 19:30:14 -05:00
Joe Wilm d304ea9b77 Add config file
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.
2016-06-30 09:04:06 -07:00