Commit graph

2064 commits

Author SHA1 Message Date
Christian Duerr c69067e1e9
Add changelog entry for 7879552 2021-07-24 20:59:38 +00:00
Christian Duerr 78795522e9
Fix insert mode crash with fullwidth characters
This patch resolves an issue with fullwidth characters, where it is
possible to crash Alacritty by moving a fullwidth character off the side
of the terminal using insert mode.

This issue occurs since trying to overwrite a fullwidth spacer in the
first column leads to an underflow when trying to access its fullwidth
character cell. During insert mode before the character is inserted into
the cell, the existing content is rotated to the right, which leads to
the fullwidth spacer being in the first column even though it is only
there temporarily to be immediately overwritten.

While it would be possible to clear the flags after rotation, this would
still leave the opportunity for other ways to trigger this issue and
cause a separate crash. So instead the column is checked while
overwriting the spacer to make sure the fullwidth character isn't
accessed if it would lead to an underflow.

The following is a minimal example for reproducing this crash:

```sh
printf "漢"

printf "\e[4h"

printf "\r"

for _ in $(seq 3 $(tput cols)); do
    printf "x"
done

printf "\r_"
```

Fixes #5337.
2021-07-22 22:11:12 +00:00
Christian Duerr 7913aa5576
Invert windows asset symlinks
This commit swaps source and target for the windows asset symlinks,
since creation of a symlink is not possible on Windows systems without
administrator permissions.

By making the files inside the source folder the source instead of the
destination, a build is still possible without requiring elevated
privileges.

Fixes #5338.
2021-07-18 19:29:38 +00:00
Christian Duerr 150b0bcb73
Fix Linux release CI build 2021-07-18 17:40:44 +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 6fb2aefde4
Remove optional releases section from appdata.xml
This removes the releases section to make the creation of new releases a
bit simpler.
2021-07-18 01:33:47 +00:00
Christian Duerr d8f0d3fabf
Fix vi cursor tracking during scrolling
This resolves an issue with the vi mode cursor where it would not keep
track of the content while scrolled up in history but instead slowly
leave the viewport due to its absolute positioning.

While an alternative solution would have been to always keep the vi mode
cursor in the same spot on the viewport, keeping track of the content is
not only more easy to implement but it also makes for a nicer connection
between the vi mode cursor and the content below it.

Fixes #5339.
2021-07-17 23:14:39 +00:00
Christian Duerr e447156612
Fix copying interrupted tab characters
Fixes #5084.
2021-07-16 19:08:07 +00:00
Christian Duerr e0f0cdfb8a
Update dependencies 2021-07-14 02:18:40 +00:00
Christian Duerr 2de20378ac
Symlink windows assets for cargo install
Fixes #5114.
2021-07-14 00:32:59 +00:00
Christian Duerr 01a7ad946e
Add libxkbcommon to INSTALL.md dependencies
Fixes #5320.
2021-07-12 01:34:37 +00:00
Christian Duerr 4c9ecd3479
Fix search regressions
Fixes #5315.
2021-07-12 01:22:49 +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
Paul Barker 4a3bcdb49d
Fix Void Linux link in the install guide 2021-07-08 11:17:50 +00:00
a5ob7r 72675db382
Fix leaving vi mode with active selection
This bug comes from 530de00049. The vi
cursor movement changes text selection range when it is on vi mode. On
the other hand the cursor movement doesn't change the range when it
isn't on vi mode. So preserve text selection range by toggling vi mode
early.
2021-07-07 22:05:05 +00:00
a5ob7r 0486c7cb13
Fix vi cursor motion with ScrollPage* actions
This fixes the regression that vi cursor doesn't move to appropriate
position to emulate vi/vim after invokes `ScrollPage*`.

To emulate vi/vim the cursor should move up/down some lines if the
viewport on topmost scrollback buffer or on bottommost one when invokes
`ScrollPage*` action. Otherwise the cursor should look like no movement
relatively on viewport.
2021-07-04 20:01:29 +00:00
Christian Duerr 9e7655ec03
Fix crash when resizing during vi mode
Our resize clamping logic for the vi mode cursor did not correctly clamp
to the viewport after the indexing change. Now it is enforced that the
vi mode cursor cannot leave the visible area after a font or viewport
size change.
2021-07-04 00:30:05 +00:00
Christian Duerr c6ed855bfa
Add buffer for PTY reads during terminal lock
Before this patch, Alacritty's PTY reader would always try to read the
PTY into a buffer and then wait for the acquisition of the terminal lock
to process this data. Since locking for the terminal could take some
time, the PTY could fill up with the thread idling while doing so.

As a solution, this patch keeps reading to a buffer while the terminal
is locked in the renderer and starts processing all buffered data as
soon as the lock is released.

This has halfed the runtime of a simple `cat` benchmark from ~9 to ~4
seconds when the font size is set to `1`. Running this patch with
"normal" grid densities does not appear to make any significant
performance differences in either direction.

One possible memory optimization for the future would be to use this
buffer for synchronized updates, but since this currently uses a dynamic
buffer and would be a bit more cluttered, it has not been implemented in
this patch.
2021-07-03 20:31:50 +00:00
Christian Duerr 4dd70ba3a1
Fix clippy warnings 2021-07-03 03:06:52 +00:00
a5ob7r b0bc2a2440
Remove .agignore
This file is a configuration file for The Silver Searcher which is
useful but not related to Alacritty and the development directly.

Also this file has no effect in practice because the ignored target no
longer exists in current repository. So nobody is affects by this
removal.
2021-06-28 09:00:13 +00:00
Tim Hourigan db0f4b5b94
Add libxkbcommon-dev to debian INSTALL.md 2021-06-27 23:41:58 +00:00
Nick Black e0b9771dbc
Remove blink capability from terminfo 2021-06-26 13:10:20 +00:00
a5ob7r fa2fa39804
Fix regex search regression 2021-06-20 18:01:47 +00:00
Joshua Ortiz 7e4325796d
Add modes to regex hint bindings
Fixes #5154.
2021-06-19 22:58:15 +00:00
Christian Duerr 0be25c5e22
Switch official IRC channel to Libera.Chat 2021-06-19 13:29:30 +00:00
a5ob7r 6f135d713a
Fix ScrollHalfPageUp vi cursor motion regression
This regression was introduced in 3bd5ac2.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-06-16 08:55:15 +00:00
Christian Duerr 3e867a0560
Fix crashes with cut-off fullwidth characters
There's a few places in Alacritty where it was assumed that after a
WIDE_CHAR cell, there'd always be a WIDE_CHAR_SPACER. However since
resizes in the alternate screen buffer do not reflow any content, it's
possible to have a WIDE_CHAR without any WIDE_CHAR_SPACER right behind
it.

This patch changes these instances to be more defensive about accepting
potentially unreasonable input data caused by alt screen resizes.

Fixes #5185.
Fixes #5170.
2021-05-28 11:00:37 +00:00
Christian Duerr 3c61e075fe
Improve rendering performance
This PR combines a couple of optimizations to drastically reduce the
time it takes to gather everything necessary for rendering Alacritty's
terminal grid.

To help with the iteration over the grid, the `DisplayIter` which made
heavy use of dynamic dispatch has been replaced with a simple addition
to the `GridIterator` which also had the benefit of making the code a
little easier to understand.

The hints/search check for each cell was always performing an array
lookup before figuring out that the cell is not part of a hint or
search. Since the general case is that the cell is neither part of hints
or search, they've been wrapped in an `Option` to make verifying their
activity a simple `is_some()` check.

For some reason the compiler was also struggling with the `cursor`
method of the `RenderableContent`. Since the iterator is explicitly
drained, the performance took a hit of multiple milliseconds for a
single branch. Our implementation does never reach the case where
draining the iterator would be necessary, so this sanity check has just
been replaced with a `debug_assert`.

Overall this has managed to reduce the time it takes to collect all
renderable content from ~7-8ms in my large grid test to just ~3-4ms.
2021-05-22 22:48:43 +00:00
Alfonso Montero c17d8db169
Add ipfs/ipns URL scheme support 2021-05-21 23:09:06 +00:00
Christian Duerr 6c00df818c
Fix startup caching of bold glyphs 2021-05-20 19:48:32 +00:00
Mark Stosberg 4d7889acbd
Fix typo in config documentation 2021-05-20 19:29:59 +00:00
Christian Duerr 38bab815fe
Add magnet URL support to config docs
Support for magnet URLs was introduced in 78e0444, however that commit
failed to document things in the alacritty.yml file.
2021-05-19 09:01:31 +00:00
Christian Duerr 6d8db6b9df
Fix default URL binding
The default binding for launching the URL hints was documented as
Ctrl+Shift+U, but never actually set. This adds this binding as the
default instead of having URLs only launchable using the mouse.
2021-05-10 21:20:09 +00:00
Christian Duerr d94c1e97a8
Fix URL highlighting with unicode whitespace
The URL highlighting regex would automatically terminate on an ascii
whitespace, however there are several other forms of whitespace that are
indistinguisable to a user from normal whitespace. To make things a
little more intuitive, all unicode whitespace will now terminate URLs.
2021-05-09 22:33:51 +00:00
Christian Duerr 0936aa6e8d
Fix unnecessary redraws due to hint highlighting
When the mouse cursor is moved by at least one cell, an update to the
highlighted hints is triggered automatically. Previously this would
always update the hints and redraw Alacritty regardless of the actualy
change to the hint highlighting.

By checking if the hint highlighting has actually changed, pointless
redraws can be prevented. This is especially helpful since mouse motions
often generate a lot of hint re-computations.
2021-05-09 20:44:14 +00:00
absorber f9d83a2836
Add Ctrl+c binding for exiting hint mode 2021-05-08 03:12:34 +00:00
Christian Duerr 7f6b7acfeb
Fix crash when copying out of bounds selections
Fixes #5067.
2021-05-07 20:47:56 +00:00
Christian Duerr 8f4b752a98
Update crossfont to 0.3.0 2021-05-01 20:06:23 +00:00
Christian Duerr edda4f7fd8
Add changelog entry for config url change 2021-05-01 17:15:51 +00:00
Christian Duerr e64e0f0df9
Fix release mode tests
Fixes #5041.
2021-05-01 16:57:52 +00:00
Christian Duerr 68bb162740
Fix single column block selection
Fixes #5039.
2021-05-01 14:24:03 +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 257d0b5fde
Add deprecation warning for mouse URL config
Fixes #5035.
2021-05-01 13:49:58 +00:00
Nathan Lilienthal e3818a226c
Use cell colors for focused match CellRgb
Fixes #5022.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-04-30 22:16:48 +00:00
Nathan Lilienthal e2a853b1a7
Cleanup config path logging without any files
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-04-30 21:59:13 +00:00
Raphael Nestler 78e04445c7
Add support for magnet URLs 2021-04-30 16:13:29 +00:00
Christian Duerr edf0faf98f
Fix highlighting multiple hints in the same line
Fixes #5010.
2021-04-30 00:23:09 +00:00
Christian Duerr 4d982894a6
Fix replacement of fullwidth characters
Fixes #3726.
2021-04-29 17:06:44 +00:00
Nathan Lilienthal 11cbc439c8 Update vi-mode Open config docs for hints 2021-04-26 19:10:00 -04:00