Commit Graph

19 Commits

Author SHA1 Message Date
Kirill Chibisov 90552e3e7f
Fix flickering during resize on Wayland
This also fixes an issue of windows not being rendered while resizing.

Fixes #6069.
2022-06-09 16:31:08 +00:00
Yuri Astrakhan 56a69c0bfe
Fix a few minor clippy lints 2022-06-02 01:22:50 +00:00
Christian Duerr d872b9f3ae
Update dependencies
This introduces some duplicate dependencies, though they are necessary
to build properly without any warnings.

Fixes #4735.
2021-02-13 18:15:57 +00:00
Christian Duerr 530de00049
Move renderable cell transformation to alacritty
This refactors a large chunk of the alacritty_terminal API to expose all
data necessary for rendering uniformly through the `renderable_content`
call. This also no longer transforms the cells for rendering by a GUI
but instead just reports the content from a terminal emulation
perspective. The transformation into renderable cells is now done inside
the alacritty crate.

Since the terminal itself only ever needs to know about modified color
RGB values, the configuration for colors was moved to the alacritty UI
code.
2021-01-24 21:45:36 +00:00
Christian Duerr 6e1b9d8b25
Replace serde's derive with custom proc macro
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.
2020-12-21 02:44:38 +00:00
Kirill Chibisov 67db9b228d
Bump glutin to 0.25.0
Fixes #4206.
Fixes #4162.
Fixes #4017.
Fixes #3998.
Fixes #3831.
Fixes #3782.
Fixes #3708.
Fixes #2734.
Fixes #2714.
Fixes #1801.
2020-10-07 17:40:50 +03:00
Kirill Chibisov 0a1683e84d
Use yellow/red from the config for message bar colors
This commit completes the effort to use config colors for
message bar content by picking red/yellow from user's
colors.normal.{red,yellow} for error/warning messages
instead of fixed colors.

It also removes alacritty_terminal::term::color::RED and
alacritty_terminal::term::color::YELLOW from the alacritty_terminal API,
bumping its version to 0.11.0-dev.

Fixes #4116.
2020-08-13 14:59:35 +03:00
Christian Duerr bedf5f3004
Invert fixed color cursor if it's close to cell bg
This should reduce the number of times people with fixed cursor colors
run into troubles when existing text is already colored.

Using just the background color as a metric instead of both background
and foreground color should ensure that the cursor still has a clear
shape, since just changing the foreground color for a cursor might be
difficult to see. Always inverting the entire cursor instead of keeping
the fixed foreground color is important to make sure the contrast isn't
messed up.

Fixes #4016.
2020-07-26 01:04:39 +00:00
Kirill Chibisov 8bd2c13490
Add option to run command on bell
Fixes #1528.
2020-07-10 22:32:44 +03:00
Christian Duerr 46c0f352c4
Add regex scrollback buffer search
This adds a new regex search which allows searching the entire
scrollback and jumping between matches using the vi mode.

All visible matches should be highlighted unless their lines are
excessively long. This should help with performance since highlighting
is done during render time.

Fixes #1017.
2020-07-09 21:45:22 +00:00
Christian Duerr 81ce93574f
Extend style guideline documentation 2020-05-05 22:50:23 +00:00
Kirill Chibisov 2fc5120327
Use config colors to theme Wayland decorations
Fixes #2092.
2020-04-09 04:02:10 +03:00
Kirill Chibisov 2365425fd2
Fix log target of color config errors
Due to incorrect log target in the color config errors, the message bar was not
cleared when the error was fixed.
2020-02-28 02:28:15 +00:00
Christian Duerr 17b8bbb908
Remove docs for 0xRRGGBB color notation 2020-02-27 23:06:04 +00:00
Christian Duerr 729eef0c93
Update to winit/glutin EventLoop 2.0
This takes the latest glutin master to port Alacritty to the EventLoop
2.0 rework.

This changes a big part of the event loop handling by pushing the event
loop in a separate thread from the renderer and running both in
parallel.

Fixes #2796.
Fixes #2694.
Fixes #2643.
Fixes #2625.
Fixes #2618.
Fixes #2601.
Fixes #2564.
Fixes #2456.
Fixes #2438.
Fixes #2334.
Fixes #2254.
Fixes #2217.
Fixes #1789.
Fixes #1750.
Fixes #1125.
2019-10-05 02:29:26 +02:00
Matthias Krüger 1067fa609b Replace uninitialized with MaybeUninit 2019-09-10 16:08:01 +00:00
Kirill Chibisov 9a159a7760 Fix cursor color setting with escape sequence
The cursor rework introduced a regression where cursor color was always picked
from a config file, rather then using `ansi::NamedColor::Cursor` for this
purpose.

This commit also removes `CursorText` option from `NamedColor` enum,
since we can't speculate with `CursorText` during runtime.

Cursor rework commits:
  cfc20d4f34
  371d13f8ef
  0d060d5d80
2019-07-10 21:24:04 +00:00
Christian Duerr 5d173f6df3
Refactor config parsing files
This is a large refactor of the config parsing structure, attempting to
reduce the size of the file a bit by splitting it up into different
modules with more specific purposes.

This also fixes #2279.
2019-05-10 11:36:16 +00:00
Theodore Dubois dbd8538762 Split alacritty into a separate crates
The crate containing the entry point is called alacritty, and the crate
containing everything else is called alacritty_terminal.
2019-04-28 13:24:58 +00:00