Commit graph

513 commits

Author SHA1 Message Date
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