Commit Graph
291 Commits
Author SHA1 Message Date
Kirill Chibisov e2b5219eb4 Fix input lag with nvidia driver on Wayland
Fixes #5694.
2021-12-27 23:31:08 +02:00
Christian Duerr 850fd1826b Bump development version to 0.11.0-dev
This is only an update to the development version and does not represent
a stable release.
2021-12-26 15:39:09 +00:00
Christian Duerr 3371851cbd Update dependencies
This update includes crossfont 0.3.2, which updates the macOS font
fallback behavior.

Fixes #3271.
2021-12-11 10:12:06 +00:00
Kirill ChibisovandChristian Duerr 4c6a763850 Bump glutin to 0.28.0
Fixes #5603.
Fixes #5422.
Fixes #5350.
Fixes #4105.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-12-03 03:50:14 +00:00
Christian Duerr c89939b5d1 Switch to clap-generated completions
The current completions required a lot of domain-specific knowledge
about each individual shell and their completion functionality. Much of
which is sparsely documented.

While clap does not generate perfect completions, since parameters like
`-e` are missing completions, it does a reasonable job while requiring
no work on writing these completions.

Since access to `cli.rs` isn't possible from the `build.rs`, these
completions aren't always generated on build. Instead a test verifies
that there has been no changes to these completions and provides a
simple code sample for re-generating them. This should provide a simple
solution with minimal overhead.
2021-11-19 23:34:40 +00:00
James McCoy b0da035e9e Update signal-hook to 0.3.10 2021-11-15 00:56:27 +00:00
Christian Duerr 1df7dc5171 Add multi-window support
Previously Alacritty would always initialize only a single terminal
emulator window feeding into the winit event loop, however some
platforms like macOS expect all windows to be spawned by the same
process and this "daemon-mode" can also come with the advantage of
increased memory efficiency.

The event loop has been restructured to handle all window-specific
events only by the event processing context with the associated window
id. This makes it possible to add new terminal windows at any time using
the WindowContext::new function call.

Some preliminary tests have shown that for empty terminals, this reduces
the cost of additional terminal emulators from ~100M to ~6M. However at
this point the robustness of the daemon against issues with individual
terminals has not been refined, making the reliability of this system
questionable.

New windows can be created either by using the new `CreateNewWindow`
action, or with the `alacritty msg create-window` subcommand. The
subcommand sends a message to an IPC socket which Alacritty listens on,
its location can be found in the `ALACRITTY_SOCKET` environment
variable.

Fixes #607.
2021-10-23 07:16:47 +00:00
Christian Duerr 62a1fad524 Migrate CLI config to structopt
While structopt also uses clap under the hood, the configuration through
annotations allows for significantly more maintainable and concise CLI
definition.

This will also make it far easier to have platform-specific options,
which is problematic with clap since no individual methods can be
removed from its builder.

The change in Alacritty's CLI has been kept to a minimum with the only
significant changes being the `--version` flag listed before the
`-v` flag and the authors all on the same line.
2021-08-18 09:36:51 +00:00
Christian Duerr 259e7c7a09 Update crossfont to 0.3.1 2021-08-01 15:32:06 +00:00
Christian Duerr 1d8bd73bc3 Bump development version to 0.10.0-dev
This is only an update to the development version and does not represent
a stable release.
2021-07-18 03:03:41 +00:00
Christian Duerr e0f0cdfb8a Update dependencies 2021-07-14 02:18:40 +00:00
David Hewitt bdfa52fcd8 Update mio-anonymous-pipes to 0.2.0
Fixes #5266.
2021-07-10 15:21:19 +00:00
Christian Duerr 8cb1acc27d Fix PTY performance regressions
The patch 9e7655e introduced some changes which improved rendering with
very dense grids, but the automatic benchmarks indicated a slight
performance difference in the `dense_cells` benchmark.

Caching the terminal lock between iterations rather than always calling
`try_lock` resolves that issue.

While breaking early in the `WouldBlock` case with `unprocessed != 0`
does also help resolve these issues, it shows some more significant
fluctuations. Combining both fixes does not help.

Additionally on Windows receiving `Ok(0)` from the PTY will also occur
instead of a `WouldBlock` error, so handling that fixes freezing on
Windows.

Fixes #5305.
2021-07-08 20:35:58 +00:00
Christian Duerr 8f4b752a98 Update crossfont to 0.3.0 2021-05-01 20:06:23 +00:00
Christian Duerr 57bb7de06b Bump development version to 0.9.0-dev
This is only an update to the development version and does not represent
a stable release.
2021-05-01 14:05:57 +00:00
Christian Duerr 33d4b833dc Update dependencies
This includes a bump to VTE resolving an issue with invalid
intermediates when transitioning from DCS to ESC sequences. This should
however not be noticeable with any existing escape sequences.

Fixes #4827.
2021-04-17 01:53:21 +00:00
Christian Duerr 96fc9ecc9a Add vi/mouse hint highlighting support
This patch removes the old url highlighting code and replaces it with a
new implementation making use of hints as sources for finding matches in
the terminal.
2021-04-13 03:24:42 +00:00
Christian Duerr edfcb81339 Run clippy on MSRV
Since not all suggested clippy lints by stable clippy are supported on
the MSRV of Alacritty, this commit moves the clippy checks to the MSRV.

Unfortunately this will mean that our lints might be significantly
behind, however it ensures our CI never blocks any code that should be
valid.

Developers themselves of course can still run the latest clippy to
follow the up to date recommendations.
2021-02-27 15:06:22 +00:00
Bastien Orivel 8409d7d5e2 Bump base64 to 0.13.0 2021-02-24 17:52:35 +00:00
Christian Duerr 9575aed681 Add support for synchronized updates
This implements support for temporarily freezing the terminal grid to
prevent rendering of incomplete frames.

This can be triggered using the escapes `DCS = 1 s` (start) and
`DCS = 2 s` (end).

The synchronization is implemented by forwarding all received PTY bytes
to a 2 MiB buffer. This should allow updating the entire grid even if it
is fairly dense. Unfortunately this also means that another branch is
necessary in Alacritty's parser which does have a slight performance
impact.

In a previous version the freezing was implemented by caching the
renderable grid state whenever a synchronized update is started. While
this strategy makes it possible to implement this without any
performance impact without synchronized updates, a significant
performance overhead is introduced whenever a synchronized update is
started. Since this can happen thousands of times per frame, it is not a
feasible solution.

While it would be possible to render at most one synchronized update per
frame, it is possible that another synchronized update comes in at any
time and stays active for an extended period. As a result the state
visible before the long synchronization would be the first received
update per frame, not the last, which could lead to the user missing
important information during the long freezing interval.

Fixes #598.
2021-02-24 16:16:38 +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
Arthur Woimbée 9f560b3e11 Update cargo lockfile
Fixes #4664.
2021-01-06 09:54:18 +00:00
Christian Duerr c1262d7890 Update vte to 0.10.0 2021-01-03 11:04:52 +00:00
Christian Duerr 8ed72cc065 Remove Windows WinPTY backend 2021-01-01 05:07:39 +00:00
Christian Duerr d0301ef655 Fix Wayland crash due to fontconfig
Fixes #4591.
2020-12-31 05:21:23 +00:00
Kirill ChibisovandChristian Duerr fdc10d270e Hide "missing" glyp for zerowidth character
This patch prevents missing zerowidth glyphs from obscuring the rendered
glyph of a cell.

The missing glyph itself is also consistently loaded and displayed on
all platforms. It is initialized once together with the ascii symbols
and then written to the atlas only once for every cached missing glyph.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-12-23 22:28:41 +00:00
Caden HausteinandChristian Duerr 8982000f01 Remove terminfo dependency
Fixes #4597.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-12-22 02:38:50 +00:00
Christian Duerr 5725f5812c Fix artifacts on macOS with transparent windows
Due to the way macOS draws shadows for transparent windows, resizing
them will lead to text artifacts remaining present after a window has
been resized.

The `invalidateShadow` call is used whenever the opacity isn't `1.0` to
make sure these shadows are cleared before redrawing, so no artifacts
remain when resizing transparent windows.

Fixes #889.
2020-12-21 06:40:22 +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
Christian Duerr 37a3198d88 Fix embedded _NET_WM_ICON on X11
Previously the _NET_WM_ICON would use the .ico which was also used for
the Windows icon. This icon used the dimensions 256x256, but the maximum
supported image size is 192x192, so a new image with the dimensions
64x64 has been added.

Since we know the image format anyways, the `image` dependency could
also be easily replaced with `png`, which cuts out a few extra unused
dependencies.
2020-12-20 07:57:03 +00:00
Kirill Chibisov 116faba7c6 Fix crash due to clipboard not being properly released on Wayland 2020-12-17 15:15:17 +03:00
Kirill Chibisov 6b208a6958 Bump glutin to 0.26.0
Fixes #4530.
Fixes #4072.
Fixes #1927.
2020-12-11 00:40:32 +00:00
Christian Duerr a2727d06f7 Fix DoS caused by excessive CSI parameter values 2020-11-26 00:57:44 +00:00
Kirill Chibisov 5b6dfb5304 Fix Cargo.lock
During 07cfe8b the regenerated Cargo.lock file was somehow missed.
2020-11-24 03:34:04 +03:00
Christian Duerr 07cfe8bbba Add support for '~/' in config imports
This allows the configuration file imports to start with '~/' and
resolve relative to the user's home directory.

There is no support for '~user/' or '$HOME/' or any other shell
expansion. However since paths relative to the home directory should be
sufficient for everything, this provides a very simple solution without
any significant drawbacks.

Fixes #4157.
2020-11-24 00:37:34 +03:00
Kirill Chibisov 9724418d35 Fix wide characters being cut off
Fixes #791.
2020-11-17 17:49:05 +03:00
Christian Duerr 2bb2ed817b Bump development version to 0.7.0-dev
This is only an update to the development version and does not represent
a stable release.
2020-11-15 13:38:46 +00:00
Christian Duerr bfb1a571d1 Update vte to 0.9.0 2020-11-13 18:47:44 +00:00
Kirill Chibisov 78f6cc4086 Update wayland-rs to 0.28.2
Fixes #4385.
2020-11-09 11:30:01 +00:00
Christian Duerr 5a3bf69e3f Remove rustc_tools_util dependency
Since our usage of the rustc_tools_util crate is so trivial, it seems
like we should be able to just inline it directly into Alacritty.

It's a very well trusted crate, being hosted directly by rust-lang and
it does not pull in any other dependencies, but having a dependency for
just 6 lines of code seems a bit extreme.
2020-10-25 05:07:28 +03:00
Christian Duerr 269f00051e Remove all duplicate dependencies from Linux/BSD
This bumps andrew and removes the last duplicate dependency
('num-traits') from Alacritty's Linux/BSD dependencies.
2020-10-24 15:26:39 +03:00
Kirill Chibisov f03269cab0 Update dependencies
Fixes #4194.
2020-10-14 19:09:19 +03:00
Kirill Chibisov 721f789b5f Make use of glutin wayland/x11 features
This should allow users that are not using Wayland/X11
to reduce the resulted binary size and compilation times.
2020-10-12 12:22:36 +03: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
Christian Duerr 56cff18486 Update cargo lockfile
This updates the lockfile to the new format introduced in Rust 1.41.0.
Since the lockfile has been completely regenerated, all depedencies were
updated.
2020-09-16 07:44:17 +03:00
Kirill Chibisov b39c791649 Update smithay-clipboard to 0.5.2
Fixes #4139.
Fixes #4085.
2020-08-30 21:18:01 +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 576252294d Add support for colon separated SGR parameters
This implements the colon separated form of SGR 38 and 48.

Fixes #1485.
2020-08-07 22:37:23 +00:00
Christian Duerr 3688b5c075 Bump version to 0.6.0-dev 2020-07-19 20:37:59 +00:00