Commit graph

1848 commits

Author SHA1 Message Date
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
Christian Duerr c688adc7b5
Fix cursor expansion across wide chars
This fixes a regression introduced in 0.7.0 where the block cursor would
not expand across both cells anymore when on top of a wide char spacer
cell.

The logic to always move the cursor on the wide char instead of the
spacer has been moved to the alacritty_terminal crate, making sure it is
always performed before any processing in the UI.
2021-04-22 20:08:58 +00:00
Christian Duerr 28abb1f9c7
Fix out of order terminal query responses
This forces all responses made to the PTY through the indirection of the
UI event loop, making sure that the writes to the PTY are in the same
order as the original requests.

This just delays all escape sequences by forcing them through the event
loop, ideally all responses which are not asynchronous (like a clipboard
read) would be made immediately. However since some escapes require
feedback from the UI to mutable structures like the config (e.g. color
query escapes), this would require additional locking.

Fixes #4872.
2021-04-17 23:20:13 +00:00
Christian Duerr a312e41595
Fix selection flooding Wayland connection
This resolves an issue where an excessive clipboard update frequency
would cause the Wayland display server to ignore necessary selection
updates.

Instead of copying the selection to the clipboard during the selection
process, it is now only copied once the mouse button is released.

Fixes #4953.
2021-04-17 19:28:23 +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 504b38cbd1
Fix mouse reports
The patch 9cb5562 has introduced a regression which would abort if a
mouse report's line was bigger than zero, which is the exact opposite of
when a mouse report is required.

Fixes #4980.
2021-04-16 20:23:54 +00:00
Christian Duerr 9cb55621f7
Fix mouse point crash on resize
This resolves an issue with Alacritty crashing after a resize, due to
the last cached mouse point being out of bounds.

Instead of caching the mouse point, it is now computed on demand to make
sure it can never be invalid.

Fixes #4977.
2021-04-15 22:16:31 +00:00
Christian Duerr 1f46bb7b92
Add hint action for moving the vi cursor
Fixes #4319.
2021-04-15 21:25:49 +00:00
Christian Duerr 05917b2740
Fix initial vi cursor position while in scrollback
Fixes #4968.
2021-04-14 19:39:35 +00:00
Christian Duerr 37f638fc42
Fix hint label with start above viewport
Fixes #4960.
2021-04-14 03:47:10 +00:00
Christian Duerr 7f31275e74
Fix URL highlight in mouse mode without shift
This resolves a regression introduced in 96fc9ec where URLs would get
highlighted on mouse hover while mouse mode is active even when the
shift modifier was not held down.
2021-04-14 01:05:20 +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
Kam Kudla 40bcdb1133
Add hide other windows binding on macOS
Fixes #3697.
2021-04-08 21:01:47 +00:00
Richard Steinmetz 78953e4f7e
Fix automatic scrolling on resize 2021-04-08 20:29:47 +00:00
Christian Duerr cbcc129440
Add copy/paste/select hint actions
This adds some built-in actions for handling hint selections without
having to spawn external applications.

The new actions are `Copy`, `Select` and `Paste`.
2021-04-03 23:52:44 +00:00
Christian Duerr 531e494cf9
Fix focused match selection color
In 3bd5ac221a a regression was introduced
which caused the selection of a focused match to invert the cell color
back to its original color. This was due to the removal of the
`is_match` flag on the renderable cell, which was used to make sure a
cell is not marked as part of a match if it is already part of a
selection.

Instead of relying on a flag that is passed through from content.rs, the
application of the cell colors is instead done in the content.rs file
directly. This not only fixes the bug with selecting the focused match,
but also makes the logic a bit more transparent.

Fixes #4934.
2021-04-02 21:36:35 +00:00
Richard Steinmetz 58cae8f2ed
Keep viewport in place during resize
Fixes #4879.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-03-31 19:11:16 +00:00