Commit graph

1927 commits

Author SHA1 Message Date
Kirill Chibisov
8e6a608b2d
Print multiline logs in one write call
Fixes potential split of multiline logs in the multithreaded context
by writing them all at once.
2020-12-10 09:00:54 +03:00
Ivan Avdeev
5ececc3105
Render underline and strikeout rects in batches
Currently Alacritty requires a separate `draw` call to OpenGL whenever a
new rectangle is rendered to the screen. With many rectangles visible,
this has a significant impact on rendering performance.

Instead of using separate draw calls, the new `RectRenderer` will build
a batch of rectangles for rendering. This makes sure that multiple
rectangles can be grouped together for single draw calls allowing a
reduced impact on rendering time.

Since this change is OpenGL 2 friendly, it should not make it more
complicated to transition away from the 3.3+ requirements like an
alternative instancing based implementation might have.
2020-12-10 05:42:03 +00:00
Christian Duerr
4975be29df
Fix scrolling region performance with fixed lines
This resolves an issue with Alacritty's scrolling region performance
when there's a number of fixed lines at the top of the screen. This
affects commonly used applications like tmux or vim.

Instead of using separate logic for when the scrolling region starts at
the top of the screen without any fixed lines, the code should now try
to figure out the target position of these fixed lines ahead of time,
swap them into place and still perform the optimized implementation to
move the grid.

This comes with the small trade-off that since lines are swapped before
rotating the screen without clearing or removing any lines during the
rotation process, that the places the fixed lines have been swapped with
will appear out of order when using scrolling regions in the primary
screen buffer. Since the use of scrolling regions primarily affects the
alternate screen and most terminals don't keep any history at all, this
should however not cause any problems.
2020-12-10 02:10:24 +00:00
Christian Duerr
e924c8441d
Remove alacritty.spec
Since Alacritty is now officially packaged by Fedora, it is no longer
necessary to provide this in the official repository.
2020-12-08 23:20:36 +00:00
Christian Duerr
9e71002e40
Fix dimming of indexed colors
It seems like the list of colors might have changed a bit, leading to
indexed colors not being transformed into their dim colors correctly.

To prevent this from happening in the future, the dimming for colors in
the range '0..=7' is now performed by offsetting them from the
'NamedColor::DimBlack'. Since this is the first dimmed color, this
should always work as long as all dimmed colors are added in the correct
order.
2020-12-05 12:03:03 +03:00
Kirill Chibisov
de9ed25966
Draw selection below Vi cursor when it's hidden 2020-11-28 04:01:20 +03:00
Christian Duerr
a2727d06f7
Fix DoS caused by excessive CSI parameter values 2020-11-26 00:57:44 +00:00
Christian Duerr
0768428190
Remove redundant CLI flags
This removes some of Alacritty's CLI flags since the same functionality
is provided by the '--option' flag now.

The removed flags are:
 * '--persistent-logging'
 * '--live-config-reload'
 * '--no-live-config-reload'
 * '--dimensions'
 * '--position'

Fixes #4246.
2020-11-26 01:49:19 +03:00
Christian Duerr
26479bb9f5
Fix CI upload assets tag matching
The previous version would search for the last tag by matching the
beginning of the tag name. By explicitly searching for the trailing `"`
with grep, an exact tag match is now enforced.

Since releases like v1.2.3 always match the beginning of their RCs
(v1.2.3-rc4), this makes sure that the assets aren't pushed to the
previous release.
2020-11-25 01:31:21 +00:00
Everlastinggit
e1246c3ea9
Fixed typo in INSTALL.md 2020-11-24 16:39:14 +00:00
Everlastinggit
9e6e35ffd7
Remove copr from installation instructions
Since Fedora now provides Alacritty in the default repository, that
should be used instead of the copr repository.
2020-11-24 01:12:13 +00:00
Kirill Chibisov
5b6dfb5304
Fix Cargo.lock
During 07cfe8b the regenerated Cargo.lock file was somehow missed.
2020-11-24 03:34:04 +03:00
Kirill Chibisov
60538d2d7f
Fix CHANGELOG sections
Commit 2fd2db4 added one more 'Added' section during rebase,
thus merging it with existing one.
2020-11-24 03:00:23 +03:00
Dettorer
2fd2db4afa
Add blinking cursor support
This adds support for blinking the terminal cursor. This can be
controlled either using the configuration file, or using escape
sequences.

The supported control sequences for changing the blinking state are
`CSI Ps SP q` and private mode 12.
2020-11-23 23:11:03 +00:00
Christian Duerr
07cfe8bbba
Add support for '~/' in config imports
This allows the configuration file imports to start with '~/' and
resolve relative to the user's home directory.

There is no support for '~user/' or '$HOME/' or any other shell
expansion. However since paths relative to the home directory should be
sufficient for everything, this provides a very simple solution without
any significant drawbacks.

Fixes #4157.
2020-11-24 00:37:34 +03:00
Kirill Chibisov
da6f0a505e
Increase font size in CSDs on Wayland
Winit changed the default font size for CSDs from 17pt to 11pt, this
patch reverts that since it is too small to be readable.
2020-11-22 01:20:04 +00:00
Kirill Chibisov
768f9e2285
Fix stdout log message order
This patch makes sure that the message for the creation of a log file is
always the first entry, before any other log file messages.

Since we initialize our log file dynamically, the message is printed as
soon as something is written to it. By making sure that we always write
to a file first and then try stdout, we can ensure that the log file is
always initialized before ever writing log messages to stdout.
2020-11-19 15:45:13 +00:00
James Simpson
c1f0e83cbb
Ignore nonexistent config imports instead of raising an error
Fixes: #4330.
2020-11-19 17:52:58 +03:00
Christian Duerr
18a226fe45
Fix vi mode terminal reset
Since the vi mode is unrelated to the terminal emulation itself, it
should not be reset during a `reset` to prevent unnecessary confusion.

This also prevents the search from switching from vi mode to vi-less
search without any indication to the user.
2020-11-19 01:15:34 +00:00
Kirill Chibisov
9724418d35
Fix wide characters being cut off
Fixes #791.
2020-11-17 17:49:05 +03:00
Christian Duerr
8b10e5e778
Reduce number of GitHub Actions CI builds
By reducing the number of CI jobs for GitHub actions, it should be
possible to get a faster overview over the status of all CI jobs. While
this does increase the total build time of GitHub Actions by reducing
parallelization, it should still finish within the SourceHut CI times.
2020-11-17 13:21:51 +00:00
Chandler Swift
c88c7830ec
Add Alpine Linux build dependencies 2020-11-16 16:07:37 +00:00
Christian Duerr
2bb2ed817b
Bump development version to 0.7.0-dev
This is only an update to the development version and does not represent
a stable release.
2020-11-15 13:38:46 +00:00
Christian Duerr
c5340a2ccc
Fix unused import warning
This fixes an unused import warning introduced with 198d3cb.
2020-11-15 00:48:23 +00:00
Kirill Chibisov
2a16cc5155
Fix zerowidth characters in the last column
This commit fixes the issue that when attempting to write zerowidth
characters into the last column, it is written in the second to last
column instead.

Fixes #4227.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-11-15 00:28:03 +00:00
Kirill Chibisov
198d3cb78d
Load only gl 3.3 functions
This commit makes 'gl::load_with' only load
symbols from the minimal OpenGL (3.3) version alacritty
aims to support. Doing so reduces the size of gl_bindings.rs
from 21K LoC to 11K LoC, and also the actual
loading by up to ~2x, thugh the loading is usually sub millisecond
anyway.
2020-11-14 21:48:24 +03:00
Kirill Chibisov
9531e661b1
Feature gate 'image' when building without x11 feature
On Wayland there's no way to embed icon into the window,
thus there's no point in loading it when x11 feature is disabled.
2020-11-14 21:10:26 +03:00
Christian Duerr
c63bdf5cb9
Fix github releases tag pattern 2020-11-14 03:51:40 +00:00
Christian Duerr
bfb1a571d1
Update vte to 0.9.0 2020-11-13 18:47:44 +00:00
Christian Duerr
9a78449876
Add ability to select text during search
This removes the restriction of not being able to select text while the
search is active, making it a bit less jarring of a UX when the user
tries to interact with the terminal during search.

Since the selection was used during vi-less search to highlight the
focused match, there is now an option for a focused match color, which
uses the inverted normal match color by default. This focused match is
used for both search modes.

Other mouse interactions are now also possible during search, like
opening URLs or clicking inside of mouse mode applications.
2020-11-13 08:40:09 +03:00
Kirill Chibisov
b6d94e7b13
Fix use after free when dropping zerowidth data
Commit ec42b42ce6 added an optional
pointer for each cell, thus some old code that was optimizing copying
with 'ptr::copy' was duplicating "unique" pointers ('Box'), which was
resulting in use after free, after attempting to free both of these
pointers.

By replacing these unsafe blocks with safe Rust, the issue itself is
fixed and the potential for future memory problems is eliminated from
this area of the code.
2020-11-13 02:22:28 +00:00
Matthew Neal
7203f226fc
Add g++ to Fedora build dependency documentation
Fixes #4400.
2020-11-10 19:33:46 +00:00
Kirill Chibisov
9a851fdbb1
Fix sr.ht clippy job
This commit brings back '--all-targets' parameter for clippy,
which was accidentally removed in dae0145.
2020-11-10 15:47:49 +00:00
Christian Duerr
dae014511d
Fix github actions clippy job 2020-11-10 04:36:19 +03:00
Kirill Chibisov
78f6cc4086
Update wayland-rs to 0.28.2
Fixes #4385.
2020-11-09 11:30:01 +00:00
Christian Duerr
5fd792fc9b
Fix configuration file formatting
The configuration file, especially the section documenting the different
binding actions, had some extremely long lines. All the text is now
reformatted to be at most 80 columns wide.

The only lines remaining which are beyond 80 columns wide are the
configuration bindings, which would significantly suffer from linebreaks
and are not plain text.
2020-11-07 05:17:32 +00:00
Nathan Lilienthal
4fc35f6038
Spawn new alacritty processes in CWD on macOS
On macOS we can use 'proc_pidinfo' to determine the working
directory of the terminal foreground process.

Fixes #1979.
2020-11-07 04:48:48 +00:00
Christian Duerr
43d1afbeeb
Migrate from Travis CI to GitHub Actions
This removes all CI builds from travis-ci, due to their recent changes
in policy and harsh limitations on builds. With build times over 2
hours, it was a significant hindrance to development.

Instead of Travis CI, the CI is now split on Sourcehut and GitHub. Since
Sourcehut only supports Linux/BSD, all builds on those operating systems
are executed there. The GitHub Actions CI is used to build for
Windows/macOS, which are not available on Sourcehut.

Since asset deployment for releases requires builds on all platforms,
this is also done on GitHub actions. Though the new `upload_asset.sh`
script makes sure that migration in the future is fairly simple and we
do not tie ourselves to the overly complicated GitHub Actions ecosystem.
2020-11-06 23:52:56 +00:00
Christian Duerr
3957a2555d
Deprecate the WinPTY backend 2020-11-06 17:33:02 +00:00
Kirill Chibisov
812c8bc14a
Add editorconfig
This commit also purges .gitignore, since the files mentioned in it
should be handled by global ignore file.

Fixes #4378.
2020-11-06 05:12:29 +03:00
Christian Duerr
ec42b42ce6
Use dynamic storage for zerowidth characters
The zerowidth characters were conventionally stored in a [char; 5].
This creates problems both by limiting the maximum number of zerowidth
characters and by increasing the cell size beyond what is necessary even
when no zerowidth characters are used.

Instead of storing zerowidth characters as a slice, a new CellExtra
struct is introduced which can store arbitrary optional cell data that
is rarely required. Since this is stored behind an optional pointer
(Option<Box<CellExtra>>), the initialization and dropping in the case
of no extra data are extremely cheap and the size penalty to cells
without this extra data is limited to 8 instead of 20 bytes.

The most noticible difference with this PR should be a reduction in
memory size of up to at least 30% (1.06G -> 733M, 100k scrollback, 72
lines, 280 columns). Since the zerowidth characters are now stored
dynamically, the limit of 5 per cell is also no longer present.
2020-11-05 04:45:14 +00:00
Christian Duerr
9028fb451a
Fix visual bell getting stuck
This resolves a problem with the visual bell where it would not
automatically trigger a redraw itself after the initial frame has been
rendered.

Since the unit of the visual bell duration is also unclear, it has been
clarified.
2020-10-30 09:22:13 +03:00
Christian Duerr
bede5d5d1c
Fix crash with large negative font offset
Fixes #4363.
2020-10-29 22:14:43 +00:00
Kirill Chibisov
a99a9fd84c
Error on warnings when running clippy
It should simplify tracking of new warnings raised on CI builds
and when cross checking. This commit also enables warnings
for 'rust_2018_idioms' and 'future_incompatible'.
2020-10-29 07:17:33 +03:00
Christian Duerr
598684243b
Fix build failure on macOS without features
Fixes #4353.
2020-10-28 01:15:49 +00:00
Christian Duerr
5a3bf69e3f
Remove rustc_tools_util dependency
Since our usage of the rustc_tools_util crate is so trivial, it seems
like we should be able to just inline it directly into Alacritty.

It's a very well trusted crate, being hosted directly by rust-lang and
it does not pull in any other dependencies, but having a dependency for
just 6 lines of code seems a bit extreme.
2020-10-25 05:07:28 +03:00
Christian Duerr
269f00051e
Remove all duplicate dependencies from Linux/BSD
This bumps andrew and removes the last duplicate dependency
('num-traits') from Alacritty's Linux/BSD dependencies.
2020-10-24 15:26:39 +03:00
Mark Lodato
f33a44e1c4
Remove unneeded collect during line rect creation 2020-10-22 19:39:38 +00:00
Christian Duerr
80688e082d
Check viewport size after initial resize
Since the 'set_inner_size' call might immediately alter the window size,
the query for the window's dimensions should be performed after the
resize has been requested.
2020-10-22 00:16:12 +03:00
Stefano Figura
21eb84fc5e
Add license symlinks for crates 2020-10-17 14:47:51 +00:00