Commit graph

1976 commits

Author SHA1 Message Date
algon e319ca93a6
Fix builtin glyphs for U+2567 and U+2568 2022-05-20 13:08:25 +03:00
Kirill Chibisov 5c51d528ea
Fix gap in builtin box drawing
Builtin box drawing glyphs in range from '\u{2580}' to `\u{2587}`
could have gap due to missing rounding. Previously height was rounded,
however not the `y` offset. This commit fixes it.
2022-05-08 11:24:51 +03:00
a5ob7r ad3ebba532
Remove unnecessary commas in config keybindings 2022-04-29 01:24:35 +00:00
mahkoh 9bbb296d1d
Fix selection copy without button release
To prevent the current selection clipboard from being overwritten right
before pasting, text is no longer copied solely because the user
scrolled the scrollback buffer.

The selection also isn't copied when a mouse button other than LMB/RMB
are released, since these are the only ones capable of modifying the
selection range.

This should prevent issues where the selection of the user gets
unexpectedly overwritten, especially in scenarios where the user is
currently in the process of pasting something into Alacritty.

Signed-off-by: Julian Orth <ju.orth@gmail.com>
2022-04-16 18:39:26 +00:00
kumattau d5cad2a862
Fix cell_height of impl From<SizeInfo<f32>> for WindowSize 2022-04-16 16:39:14 +03:00
Kirill Chibisov 673710487a
Extract SizeInfo from alacritty_terminal
The `SizeInfo` is a SizeInfo used for rendering, which contains
information about padding, and such, however all the terminal need is
number of visible lines and columns.
2022-04-06 13:06:39 +03:00
Kirill Chibisov 851dbc328e
Disallow OSC 52 for unfocused window
This leads to issues on macOS, since if we store clipboard at the same
time it could error out. Also, on e.g. Wayland the clipboard store for
unfocused window won't work anyway.
2022-04-03 23:08:44 +03:00
Christian Duerr 49d64fbeec
Fix OSC 4 color response format
The commit 60ef17e introduced support for the color query response
escape for OSC 4, however it did omit the `4;` prefix and started the
OSC with just the color index.

This patch fixes this bug and correctly responds to queries with full
OSC 4 format, including prefix plus color index.

Fixes #5981.
2022-03-31 23:10:12 +00:00
Kirill Chibisov b16fe1259c
Reset blinking on search bindings in Vi mode
The Vi cursor is used as the current match indicator, however when
it's blinking during search jumps the current match is invisible.

Fixes #5934.
2022-03-25 15:02:44 +03:00
Kirill Chibisov e7bb6c2ea7
Persist OpenGL context creation flags
This commit persists OpenGL context creation flags from previous window
build attempts saving time in multiwindow context.

It also creates window as srgb by default, since it's what Alacritty is
rendering in. For reference [1] and [2]. Moreover the fallback for 10
bit colors is also added.

[1] - https://github.com/alacritty/alacritty/issues/4939 and
[2] - https://github.com/alacritty/alacritty/issues/3756.

Fixes #4703.
2022-03-24 12:13:30 +03:00
Kirill Chibisov f4bdf5fb36
Add colored underline support
This commit adds support for colored underline and refines the dynamic
extra storage. The extra storage now is using `Arc` making cloning it way
faster compared to `Box` approach which scales really well when it comes
to cloning in `Term::write_at_cursor`, since cloning `Arc` is constant
time.

Fixes #4142.
2022-03-16 19:27:55 +03:00
Kirill Chibisov 589c1e9c6b
Use center of the pixel when aligning undercurl
Since `x` position in rect shader represents left side of the pixel we
should use the center of it when dealing with contiguous functions.
2022-03-14 08:52:53 +03:00
Kirill Chibisov 7312f33f67
Fix font.glyph_offset not live reloading
Fixes #5944.
2022-03-11 12:34:15 +03:00
Christian Duerr 0965773657
Fix crash when searching during reset
This fixes a crash which occurs when the terminal is reset while
searching, due to the vi mode cursor being outside of the visible area.

This also fixes an issue where the search state reset would incorrectly
clamp the vi mode cursor to the grid, rather than the absolute viewport
position.

While this fix does resolve all crashes when searching while running
`cat /dev/urandom`, it does raise the question if manually clamping the
vi mode cursor in every location where it is modified is the right
choice.

A follow-up to provide a safer API which guarantees correct modification
of the vi mode cursor location is probably a good idea.

Fixes #5942.
2022-03-10 22:45:20 +03:00
Kirill Chibisov a69c3c408f
Fix line indicator damage computation
The starting point of damage should be computed from the right side
of the terminal, not from the starting point of line indicator.
2022-03-10 15:25:01 +03:00
Kirill Chibisov dbccd7e30f
Use round instead of ceil for line position
Ceiling line position results in strikeout line being lower than
it should.
2022-03-06 19:34:12 +03:00
Kirill Chibisov d8113dc2b6
Fix gap calculation for dashed underline 2022-03-02 22:35:19 +03:00
Kirill Chibisov 1880522b64
Add fallback GLES2 renderer
Currently Alacritty only works on hardware which supports OpenGL 3.3 or
more, which can become problematic with older devices. This patch adds a
new GLES2 renderer, since it is much more widely supported, especially
on weaker hardware like phones or a Raspberry Pi.

While the GLES2 renderer is slower than the OpenGL 3.3+ version, it is
still significantly faster than software rendering. However because of
this performance difference it is only used when necessary and there
should be no difference for machines supporting OpenGL 3.3+.

The two renderers are largely independent and separated in the
`renderer/text/glsl3` and `renderer/text/gles2` modules. Separate
shaders are also required for text rendering. The rectangle rendering
for underlines and the visual bell works identically for both versions,
but does have some version-specific shader code.

Fixes #128.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2022-03-02 10:05:12 +00:00
Chris Copeland 00383ae967
Add ToggleMaximized key binding action 2022-02-27 18:35:23 +00:00
Christian Duerr 13b6248dd9
Add version 0.10.1 to changelog 2022-02-24 07:17:25 +03:00
nibon7 8ea6c3bc52
Omit git version hash when git command fails 2022-02-22 13:08:49 +00:00
Kirill Chibisov 36e981ad4b
Don't use 'origin_upper_left' in rect shaders 2022-02-22 13:57:04 +03:00
Kirill Chibisov 4734b2b850
Don't load font twice during display creation
This commit finishes the effort from a64553b to avoid reloading font
twice during startup, since the original issue is with getting font
metrics without building the glyph cache.
2022-02-18 01:27:10 +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
Greg Depoire--Ferrer a64553bbaf
Reuse Rasterizer in Display::new
Instead of creating a `Rasterizer` to guess the window dimensions,
dropping it and then creating a new one for the glyph cache, reuse the
same `Rasterizer`.

This prevents the font from being loaded twice during startup.
2022-02-16 20:57:46 +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 774eb03f4f
Clear damage rects right after drawing
Since we could queue damage before we get into the actual rendering
we should clear it after drawing not before.
2022-02-11 02:04:50 +03:00
Kirill Chibisov 933030efd4
Fix terminal not being damage when only font size changed
If font size changes however the cells stay the same the terminal won't
be damaged, since it wasn't resized, however the visual change happened,
thus the entire screen should be damaged.
2022-02-10 23:42:33 +03:00
Kirill Chibisov c35ccaf9b5
Make undercurls thickness close to underlines
Fixes #5873.
2022-02-10 15:29:03 +03:00
Christian Duerr eefce4e9af
Add note about publishing RCs to crates.io
We've been testing out the pre-release feature of crates.io and there
haven't been any major issues. So this updates the documentation to
recommend publishing to crates.io even before the official release.
2022-02-10 11:09:23 +00:00
Christian Duerr d1608dd03e
Add version to info log 2022-02-09 23:41:54 +03:00
Kirill Chibisov 8afeb2c602
Fix warnings when building only with Wayland feature
This commit also makes our CI fail hard when warning encountered when
building only for either Wayland or X11.
2022-02-09 19:25:36 +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
sckzor 7263d223bf
Add instructions for building without X11/Wayland 2022-02-08 11:43:27 +00:00
Kirill Chibisov c2959f45ec
Fix alacritty_terminal not emitting damage on color change 2022-02-07 22:18:51 +03:00
Thomas Churchman 998250f3c3
Fix renderable_cursor method documentation
This method no longer returns an `Option` since #5773.

Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
2022-02-03 12:04:46 +00:00
Kirill Chibisov d22cd7409c
Fix builtin font block elements going invisible 2022-02-03 03:22:28 +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 40b5e179a3
Fix terminal damage after leaving Vi mode
This fixes an issue when search results were not damaged when leaving Vi
mode.
2022-02-02 20:20:14 +03: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
oxalica d58dff18ef
Clean up and abstract shader creation code
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2022-01-30 23:57:25 +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 efae2cc80c
Log used display server on Linux/BSD
This also fixes a bug where the welcome log message wasn't logged.
2022-01-30 06:36:35 +00: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 d1deff9fae
Remove outdated changelog URLs
Alacritty's website (https://alacritty.org) is now advertised publicly
on the GitHub page. Since that includes the old 0.3.0 and 0.5.0
changelogs, it's not necessary to point them out separately anymore.
2022-01-23 14:22:23 +00:00
Christian Duerr 9f6b49ca8f
Fix logfile overwriting existing files 2022-01-22 22:48:44 +00:00
Ömer Sinan Ağacan 4e91e99de3
Fix typo in SizeInfo padding_y rustdoc 2022-01-21 13:45:37 +00:00
Kirill Chibisov 14c22b172f
Reset cursor blinking on ToggleViMode
Fixes #4468.
2022-01-21 12:48:15 +03:00