Commit graph

565 commits

Author SHA1 Message Date
Christian Duerr 13b6248dd9
Add version 0.10.1 to changelog 2022-02-24 07:17:25 +03:00
mahkoh aaab88c5c5
Account for absolute WAYLAND_DISPLAY paths
If WAYLAND_DISPLAY contains a '/', we have to replace with with another
character before using WAYLAND_DISPLAY as a path component.
2022-02-16 21:15:50 +00:00
Kirill Chibisov ed5dbc1118
Add support for dashed and dotted underlines
This finishes implementation of underline styles provided by
`CSI 4 : [1-5] m` escape sequence.
2022-02-14 19:10:13 +03:00
Kirill Chibisov 59f16f6b15
Fix alpha when using colors.transparent_background_colors
The alpha is expected to be premultiplied from the text shader, so
we should apply it to the background color.
2022-02-09 17:41:57 +03:00
Kirill Chibisov 73c3dd8628
Add support for drawing undercurls
Fixes #1628.
2022-02-08 20:47:31 +03:00
Christian Duerr 4bf8f375ef
Fix repeated permission requests on M1 macs
This adds a codesign step to our makefile build which should
automatically sign the application and resolve the issues on M1 macs
where Alacritty constantly requests permissions.

Since self-signing does still seem to fix this issue after sharing the
resulting `Alacritty.app` with other M1 macs, the binary produced by our
release build should also be fixed automatically.

Fixes #5840.
2022-02-02 19:23:29 +00:00
Kirill Chibisov 8f1abe13e6
Add damage tracking and reporting to compatible compositors
This allows compositors to only process damaged (that is, updated)
regions of our window buffer, which for larger window sizes (think 4k)
should significantly reduce compositing workload under compositors that
support/honor it, which is good for performance, battery life and lower
latency over remote connections like VNC.

On Wayland, clients are expected to always report correct damage, so
this makes us a good citizen there. It can also aid remote desktop
(waypipe, rdp, vnc, ...) and other types of screencopy by having damage
bubble up correctly.

Fixes #3186.
2022-02-02 00:12:58 +03:00
Kirill Chibisov 5459492eae
Use cell width to compute builtin font thickness
While using underline thickness could sound logical to draw other
lines most fonts don't make underlines thick compared to cell bounding
box if you increase font size. So instead we're using cell width to
scale builtin font nicely.

This commit also adjusts arcs drawing and alignment.

Fixes #5826.
Fixes #5821.
2022-01-30 15:46:02 +03:00
Kirill Chibisov f6651a997b
Account for font.offset and glyph.offset in built-in font
This commit takes into account `font.offset` and `font.glyph_offset`
when generating built-in font.
2022-01-29 23:06:44 +03:00
zandr 094c2c9269
Add option to control built-in box drawing chars
This commit adds the config `font.builtin_box_drawing` option to
control built-in font, which is enabled by default.
2022-01-29 22:50:44 +03:00
Christian Duerr 9f6b49ca8f
Fix logfile overwriting existing files 2022-01-22 22:48:44 +00:00
DaftMouse c4d610d5bf
Fix OSC 104 with empty second parameter
This fixes a bug where using OSC 104 without parameters but
with a trailling semicolon (e.g. '\e]104;\e\\') would not be handled.

Fixes #5542.
2022-01-20 23:57:58 +00:00
DaftMouse 60ef17e8e9
Add ´?´ support to OSC 4 2022-01-15 03:35:05 +00:00
Christian Duerr e38f51c6bd
Remove time dependency
In 7398e9f a regression was introduced which causes Alacritty to crash
on startup since wayland has a keyboard repeat rate thread started
before our logger is initialized.

Since the latest version of time was rather inconvenient to use anyway
and there is no nice solution for this issue other than downgrading the
`time` version again, the time since startup is now logged instead of
the local time.

This should still provide all the relevant information, while getting
rid of an unnecessary dependency. While it would be possible to also
print the delta between log messages, this can be trivially computed so
it has been omitted to skip adding another `Mutex` to the `Logger`
struct.
2022-01-13 08:36:22 +03:00
Christian Duerr ed35d033ae
Fix fullwidth char regex search infinite loop
This resolves an issue where the regex search could loop indefinitely
when the end point was defined in a location containing a fullwidth
character, thus skipping over the end before termination.

Fixes #5753.
2022-01-08 20:24:42 +00:00
Kirill Chibisov f7177101ed
Use builtin font for box drawing unicode characters
This commit adds hand rolled drawing of unicode box drawing[1] and
block elements[2] from ranges U+2500 up to U+259f. While using system
font for such characters will look better most of the time, the
characters tend to overlap or not align, so providing builtin font is
the lesser evil here.

[1] - https://www.unicode.org/charts/PDF/U2500.pdf
[2] - https://www.unicode.org/charts/PDF/U2580.pdf

Fixes #5485.
2022-01-06 00:45:06 +03:00
a5ob7r 2057ac243a
Trim \n from hints/semantic-/simple selection
Before this patch a hint regex ending in the last column would append a
newline, despite this newline being "invisible" to the user. To match
the expected behavior, newlines are trimmed from regex hint matches.

To ensure consistency the simple and semantic selection also do not
include a newline at the end of the copied text anymore.

Fixes #5697.
2022-01-04 21:46:20 +00:00
Christian Duerr 437f42f8d3
Migrate from structopt to clap 3 2022-01-04 18:25:26 +00:00
Kirill Chibisov e2b5219eb4
Fix input lag with nvidia driver on Wayland
Fixes #5694.
2021-12-27 23:31:08 +02:00
Christian Duerr f0934d8440
Migrate to 2021 edition 2021-12-26 16:47:57 +00: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
Jorge Carrasco f1802c1cda
Spawn children from foreground working directory
To allow applications spawned by Alacritty to make use of the
shell/foreground process' working directory, it is now set for all new
processes spawned by Alacritty on Unix platforms.

Fixes #5616.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-12-18 17:27:10 +00:00
a5ob7r cded85a2f2
Keep history position when viewport is cleared
This patch resolves a behavior that display area doesn't keep track of
content in a scrollback buffer due to display offset reset when viewport
clear is invoked.

This is similar to #5341, but this problem is caused by viewport clear
instead of new outputs to the viewport.
2021-12-18 15:36:56 +00:00
jeremycostanzo 8e58409930
Remove trailing whitespace from block selection
Fixes #5638.
2021-12-18 15:18:19 +00:00
a5ob7r a1083d18ed
Fix vi cursor moving incorrectly with new output
This fixes an issue where the vi cursor would move down one line if it's
positioned at the topmost visible line, while at least partially scrolled
up into history, when new lines are added to the terminal.

This problem is caused by using a display offset of a grid not scrolled
yet when scrolling and determining a new vi cursor position.
2021-12-03 19:33:21 +00:00
a5ob7r 7e736c00f6
Fix crash when vi cursor in history during clear
Fixes #5544.
2021-12-03 07:45:05 +00:00
Kirill Chibisov 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
Scott Freeman e648aae0eb
Fix crash with empty post-processed matches
Fixes #5492.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2021-11-11 19:04:25 +00:00
Christian Duerr b885ec9cd3
Add alacritty-msg manpage to documentation
The original multiwindow PR added a new manpage, however this was not
properly documented or included in our CI. This patch resolves these
issues.
2021-11-08 23:22:09 +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 d8a98f8829
Fix cursor inversion logic
The existing cursor inversion logic was causing more problems than it
solved, without solving the problem of invisible cursor when inverting a
cell with matching foreground and background colors.

This patch reworks this logic and only inverts the cursor when the
foreground and background colors of the cursor are similar and the
cursor colors aren't set to fixed RGB values.

Fixes #4564.
Fixes #5550.
2021-10-22 06:33:34 +00:00
Christian Duerr 8cda3d1405
Fix incorrect vi mode search origin
Fixes #5460.
2021-09-28 08:30:41 +00:00
Christian Duerr b6e05d2dce
Fix vi indicator obstructing vi mode cursor
Fixes #5504.
2021-09-27 03:51:58 +00:00
Naïm Favier 70d3b4ef6c
Watch non-canonical path for config symlinks
To make it possible to detect the replacement of the configuration file
when it is a symlink, the symlinks path has to be observed in addition
to the canonicalized path. That way changes to either file will trigger
a live config reload.

Multiple layers of symlinks would still not get detected when any
symlink other than the configuration file itself is replaced, but this
patch should cover most realistic usage scenarios.
2021-08-27 21:30:39 +00:00
Christian Duerr abed2e9748
Add macOS ARM builds to CI 2021-08-17 18:04:46 +00:00
Kirill Chibisov c24d7dfd0d
Add option to apply opacity to all background colors
In some cases it could be desired to apply 'background_opacity'
to all background colors instead of just 'colors.primary.background',
thus adding an 'colors.opaque_background_colors' option to control that.

Fixes #741.
2021-08-16 14:49:14 +03:00
Christian Duerr 259e7c7a09
Update crossfont to 0.3.1 2021-08-01 15:32:06 +00:00
Jason Heard 3c309a0953
Add ExpandSelection mouse binding action
Fixes #4132.
2021-07-29 15:40:51 +00:00
Christian Duerr c69067e1e9
Add changelog entry for 7879552 2021-07-24 20:59:38 +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 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 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
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
Joshua Ortiz 7e4325796d
Add modes to regex hint bindings
Fixes #5154.
2021-06-19 22:58:15 +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 edda4f7fd8
Add changelog entry for config url change 2021-05-01 17:15:51 +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
Raphael Nestler 78e04445c7
Add support for magnet URLs 2021-04-30 16:13:29 +00:00
Christian Duerr 4d982894a6
Fix replacement of fullwidth characters
Fixes #3726.
2021-04-29 17:06:44 +00: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 05917b2740
Fix initial vi cursor position while in scrollback
Fixes #4968.
2021-04-14 19:39:35 +00:00
Kam Kudla 40bcdb1133
Add hide other windows binding on macOS
Fixes #3697.
2021-04-08 21:01:47 +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
Stokhos 974392cdc6
Fix cursor thickness on wide cells
Fixes #4922.
2021-03-28 18:02:12 +00:00
Serban Constantin 17923efccf
Fix URLs opening in explorer on Windows 2021-03-15 14:27:57 +00:00
Christian Duerr a954e076ca
Add regex terminal hints
This adds support for hints, which allow opening parts of the visual
buffer with external programs if they match a certain regex.

This is done using a visual overlay triggered on a specified key
binding, which then instructs the user which keys they need to press to
pass the text to the application.

In the future it should be possible to supply some built-in actions for
Copy/Pasting the action and using this to launch text when clicking on
it with the mouse. But the current implementation should already be
useful as-is.

Fixes #2792.
Fixes #2536.
2021-03-01 19:50:39 +00:00
Christian Duerr 772afc6a8a
Remove incorrect changelog entry
Since the bug was not present in the 0.7.2 release, there is no need to
add a changelog entry for this fix.
2021-03-01 00:50:47 +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
Kirill Chibisov 72b341425d
Fix hollow block cursor being drawn for hidden cursor
Commit 530de00 refactored large chunk of Alacritty's internal handling
of renderable cells, cursors, and such. This patch fixes a regression
where a hollow block cursor was drawn for unfocused windows even if the
terminal cursor was hidden.
2021-02-26 20:36:38 +00:00
Christian Duerr ea24a106e9
Fix vi cursor after leaving search
This resolves an issue which caused the vi cursor position to be
incorrect when leaving the search with the vi cursor at the far bottom.

Previously this could lead to the vi cursor disappearing completely,
when starting a vi mode search that has a match on the last line while
the original vi mode cursor was right above it.

Fixes #4833.
2021-02-26 19:54:09 +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 35e6fdaddd
Fix selection after search without match
This resolves an issue where the last match would be selected after
leaving non-vi search, even if further changes to the search regex did
not result in any matches.

Fixes #4831.
2021-02-22 23:54:12 +00:00
Christian Duerr 369c927d9d
Add version 0.7.2 to changelog 2021-02-20 00:33:02 +00:00
Christian Duerr fc87aaa4b1
Limit the maximum DPR on X11 to 10
Since there have a bunch of problems caused by an excessive DPI reported
by XRandr, this limits the maximum DPR on X11 to 10.

These issues would commonly cause problems like long startup times or
crashes, which are hard to troubleshoot for the user. While a limit of
10 might not eliminate all of these issues, it should still make it
possible for Alacritty to start to make troubleshooting simpler.

Fixes #3214.
2021-02-15 14:58:12 +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
Nathan Lilienthal a5e2ccd5ab Fix the estimated DPR to 1 on Wayland.
On Wayland, regardless of the underlying scale factor for an output, The
scale factor is 1.0 until we receive the first DPRChanged event. To
correctly calculate the window sizes, we must use a DPR of 1.0 as well.

Ideally we would know what the DPR of the window we're being opened in
is going to be, and avoid the estimation guessing game, but that doesn't
seem possible with the current interfaces provided by the window
systems.
2021-02-04 09:30:10 -05:00
Christian Duerr 73759da0f5
Fix segmentation fault on shutdown with Wayland
Fixes #4702.
2021-01-29 22:41:15 +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
Jason 34435ed776
Update shell completions
This fixes the shell completion by removing the flags removed from the
CLI in 0768428 and adding the new options flag.
2021-01-17 11:22:06 +00:00
Khinenw 3ed9f9ac38
Add IME support for Windows 2021-01-15 08:48:30 +00:00
r-c-f aefffde539
Fix assertion crash on 32-bit systems
Fixes #4687.
2021-01-11 12:42:06 +00:00
Christian Duerr 1260c4bf6f
Fix jumping between matches in reverse vi search
Fixes #4676.
2021-01-08 16:40:45 +00:00
Christian Duerr 6ff4e840f8
Bump development version to 0.8.0-dev
This is only an update to the development version and does not represent
a stable release.
2021-01-04 09:55:13 +00:00
Christian Duerr 43ea180d8e
Fix movement between matches in vi-less search
This resolves various bugs related to vi-less search. The primary issue
was that when jumping between matches more than 1000 lines apart, the
search would get stuck and not advance between matches properly due to
the 1000 line synchronous search limit.

Some other issues related to the tracking of the search origin have also
been fixed, improving the viewport positioning while interacting with
the search outside of vi mode. This was done by keeping the search
origin outside of the viewport, which allows for search to start right
at the first character. Previously the search was on top of the first
character which lead to it being excluded from search.

Fixes #4626.
2021-01-01 09:21:02 +00:00
Christian Duerr a1e2d6a557
Add vi/search line indicator
This adds a new visual indicator which shows the position in history of
either the display offset during search, or the vi mode cursor.

To make it as unintrusive as possible, the overlay is hidden whenever
the vi mode cursor collides with its position.

Fixes #3984.
2021-01-01 05:19:03 +00:00
Christian Duerr 8ed72cc065
Remove Windows WinPTY backend 2021-01-01 05:07:39 +00:00
Christian Duerr 0aa1df327b
Add default binding to cancel search on Ctrl+C
Fixes #4612.
2020-12-31 05:33:58 +00:00
Christian Duerr d0301ef655
Fix Wayland crash due to fontconfig
Fixes #4591.
2020-12-31 05:21:23 +00:00
Christian Duerr 0790605adf
Fix characters getting swallowed during IME input
This reverts 1d00883 since it is not necessary anymore after all search
bindings are now proper key bindings. This fixes a bug which would cause
the first character to be swallowed when using IME after triggering any
key binding which doesn't send any `ReceivedCharacter` event.

Fixes #4588.
2020-12-31 05:06:15 +00:00
Kirill Chibisov 12fbd0051c
Draw cursor with rect renderer
This commit makes cursors being drawn via rects, thus it's always above
underlines/strikeouts. Also, since the cursor isn't a glyph anymore, it
can't be obscured due to atlas switching while glyphs are rendered.

Fixes #4404.
Fixes #3471.
2020-12-28 09:45:39 +00:00
Kirill Chibisov 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
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 f016a209b4
Add search history support
This adds a history to the regex search limited to at most 255 entries.
Whenever a search is either confirmed or cancelled, the last regex is
entered into the history and can be accessed when a new search is
started.

This should help users recover complicated search regexes after
accidentally discarding them, or handle repeated searches with the same
regexes.

Fixes #4095.
2020-12-20 04:27:08 +00:00
Christian Duerr 8a7f8c9d3e
Add separate mode for search bindings 2020-12-19 04:07:20 +00:00
Kirill Chibisov 116faba7c6
Fix crash due to clipboard not being properly released on Wayland 2020-12-17 15:15:17 +03:00
Christian Duerr c065c5f2f9
Fix invalid ESC escape sequence parsing
This strictens the ESC escape sequence parser to prevent invalid
intermediates from being ignored. Previously the parser would just look
at the first intermediate without validating that the rest of them is
empty.

If an escape like `\e(#0` is used now, it will no longer be accepted as
`\e(0` since the intermediate `#` is also present.
2020-12-17 01:05:40 +00:00
Christian Duerr 1e9b550f44
Increase file watcher delay on BSD
Since BSD does not support inotify polling in the `notify` crate and
instead relies on manual filesystem polling, this would cause a high CPU
usage at 100 polls a second.

A separate polling rate of once per second is now used for platforms
which do not support filesystem polling, allowing users to still make
use of live config reload on BSD.

Fixes #3871.
2020-12-17 00:52:03 +00:00
Christian Duerr bb4fddd593
Fix draining of PTY when holding on exit
Fixes #4189.
2020-12-17 00:39:15 +00:00
Christian Duerr 4de1048628
Fix live reload with broken yaml on start
Since the current behavior would just load the default configuration
file whenever the configuration file couldn't be loaded, the path was
not set to any value. As a result however, the live config reload
feature would not work with a broken yaml (one which cannot be
deserialized, not one with warnings).

If a configuration file has been specified, but the deserialization
still failed, the path is now preserved on the default configuration
file to make it possible to live reload a fix for the issue.

Fixes #4561.
2020-12-14 00:22:16 +00:00
Christian Duerr f701b22c2d
Fix cursor reports with mouse outside of window
Previously Alacritty would not report cursor escapes to the application
when a mouse button was held down and the mouse was moved. This prevents
applications like tmux from updating their selection.

Similarly to how windowing libraries keep reporting mouse events when
the left mouse button is held down over the window, the escape sequences
are now clamped to within the grid and reported to applications.

Fixes #4566.
2020-12-13 05:59:30 +03:00