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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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>
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.
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.
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.
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.
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.
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.
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.
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'.
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.
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.