Commit graph

374 commits

Author SHA1 Message Date
Christian Duerr 1d00883f10
Fix characters swallowed during search
This resolves a bug where characters get swallowed when pressing them
after pressing backspace before the backspace key is released.
2020-08-09 23:29:58 +00:00
Christian Duerr 4b516c6365
Add ^C binding to cancel search and leave Vi mode
Fixes #4089.
2020-08-10 01:57:55 +03:00
Christian Duerr 576252294d
Add support for colon separated SGR parameters
This implements the colon separated form of SGR 38 and 48.

Fixes #1485.
2020-08-07 22:37:23 +00:00
Christian Duerr 291de2500f
Use tcgetpgrp to get PID for SpawnNewInstance
Fixes #4082.
2020-08-06 00:42:49 +00:00
Joe Wilm 99c34c7ce9
Reduce InstanceData footprint
The InstanceData type in the rendering subsystem was previously 17 f32s
plus one u8 which occupied a total of 72 bytes per instance. This meant
that for every character or background cell drawn, 72 bytes were sent to
the GPU. In the case of a 400x100 cell grid, a total of 2.9MB would be
sent.

This patch reduces InstanceData's size to 36 bytes, a 50% improvement!
Using the above example for comparison, a worst case of 1.44MB would be
transferred.

The motivation for this patch comes from macOS. Once the terminal grid
would reach a certain size, performance experienced a sharp and dramatic
drop (render times would go from ~3ms to ~16ms). I don't want to
speculate too much on the underlying issue, but suffice it to say that
this patch alleviates the problem in my testing.

While the performance impact was most significant on macOS, with
rendering times cut by more than 50% in some cases, this also results in
a measurable performance difference on other systems with high density
grids.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-08-05 00:24:51 +00:00
Christian Duerr 8b5787a21e
Fix negative window position
This resolves an issue where negative window positions set in the
configuration file would not place the Alacritty window in the correct
location.

Fixes #4061.
2020-08-02 20:09:53 +00:00
Kirill Chibisov c015b39070 Remove 0.5.0 changelog suffix
This is only an update to the changelog and does not represent a stable
release.
2020-08-01 00:38:28 +00:00
Christian Duerr a2b7c9544b Unify changelog section order
This clarifies the order of subsections in the changelog. All entries
are now defined in the order `Packaging`, `Removed`, `Added`, `Changed`
and `Fixed`.

The sections `Security` and `Deprecated` have been removed. Since
deprecation should always just be a soft deprecation with clear user
warnings, it's not much different from just `Changed`, so that should
make it easier to decide where to put things. The `Security` section is
often not clear enough since a lot of changes might have some form of
security impact depending on interpretation. Since there's unlikely to
be any major security advisories from the Alacritty project, that
section is not particularly useful.

The `Added`, `Changed` and `Fixed` order follows the interest of the
user and the impact on them. This puts the most interesting new features
front and center while allowing to go for a deep dive to see if specific
bugs have been fixed.

The `Removed` section was put last since realistically this should not
affect users. All options should be gradually deprecated and no major
features should just get removed. So most of the time this will just
list deprecated features that are now completely removed, which usually
means there's no impact for users that updated from the last version.
2020-07-31 21:01:36 +00:00
Christian Duerr 6378830469 Fix 0.5.0 changelog 2020-07-31 21:01:36 +00:00
Christian Duerr 57c4ac9145
Remove snap packaging config
Since Alacritty should not be responsible for packaging and the
maintainers of the snap package have not kept it up to date, this
removes its configuration file.
2020-07-30 04:02:16 +00:00
Kirill Chibisov 6c4e45f3a6
Bump minimum supported Rust version to 1.43.0 2020-07-28 13:00:55 +03:00
Christian Duerr bedf5f3004
Invert fixed color cursor if it's close to cell bg
This should reduce the number of times people with fixed cursor colors
run into troubles when existing text is already colored.

Using just the background color as a metric instead of both background
and foreground color should ensure that the cursor still has a clear
shape, since just changing the foreground color for a cursor might be
difficult to see. Always inverting the entire cursor instead of keeping
the fixed foreground color is important to make sure the contrast isn't
messed up.

Fixes #4016.
2020-07-26 01:04:39 +00:00
Christian Duerr 0dfd8601c9
Add secondary DA support
This adds support for the secondary DA escape sequence response.
Alacritty's version is formatted allowing for up to 99 minor and patch
versions, which should be sufficient.

The tertiary DA is intentionally not implemented and marked as rejected
in the documentation, since a lot of terminals do not support it, or
report useless data (XTerm/URxvt/Kitty).

Fixes #3100.
2020-07-23 21:55:15 +00:00
Christian Duerr dd32447bc2
Improve selection expansion changelog entry 2020-07-22 18:11:24 +00:00
Christian Duerr 3688b5c075
Bump version to 0.6.0-dev 2020-07-19 20:37:59 +00:00
Mattbazooka 76a4c373da
Fallback to SHELL instead of passwd if present
Instead of just always falling back to the shell specified in the passwd
file when no config or cli shell was specified, Alacritty will not first
look at the `$SHELL` environment variable. If this is unset, it will
still read the passwd file.

Since macOS is a bit peculiar and does not set the `$SHELL` environment
variable by default, it is set manually to the shell used by Alacritty
while any existing `$SHELL` variables are ignored. This matches the
behavior of iTerm and Terminal.app.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-07-14 09:03:36 +00:00
cynecx 68209e88fd
Fix freetype 26.6 format conversion
This resolves a rounding issue when converting to the 26.6 format used
by freetype for character sizes.

This rounding behavior is taken from cairo:
https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/src/cairo-ft-font.c#L900-903

There are various different implementations of the F26Dot6 conversion
online, but the rounding that cairo does seems to be the most common.
Since cairo is very commonly used, it should produce good results
compared with the rest of Linux text rendering.

Fixes #2780.

Co-authored-by: Christian Duerr <contact@christianduerr.com>
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
2020-07-14 01:13:19 +00:00
Kirill Chibisov 18cf806a27
Remove gui dependencies from alacritty_terminal
This commit removes font dependency from alacritty_terminal,
so it'll simplify the usage of alacritty_terminal as a library,
since you won't link to system's libraries anymore. It also
moves many alacritty related config options from it.

Fixes #3393.
2020-07-11 20:03:09 +03:00
Christian Duerr 521a58d691
Fix crash when configured font is missing
Fixes #3942.
2020-07-11 02:41:45 +03:00
Kirill Chibisov 8bd2c13490
Add option to run command on bell
Fixes #1528.
2020-07-10 22:32:44 +03:00
Kirill Chibisov b78f3d1339
Set default FreeType properties
In addition it also starts respecting Fontconfig's `autohint`
and `hinting` options.

Fixes #3534.
2020-07-10 21:54:35 +03:00
Christian Duerr 44f25493ca
Bump urlocator and unicode-width 2020-07-10 02:26:57 +03:00
Kirill Chibisov 0210a43196
Fail compilation if Fontconfig is not installed on Linux/BSD
Statically linking Fontconfig was leading to slow startup and
various errors, so forcing the use of system's library.
2020-07-10 01:24:55 +03:00
Christian Duerr 46c0f352c4
Add regex scrollback buffer search
This adds a new regex search which allows searching the entire
scrollback and jumping between matches using the vi mode.

All visible matches should be highlighted unless their lines are
excessively long. This should help with performance since highlighting
is done during render time.

Fixes #1017.
2020-07-09 21:45:22 +00:00
Christian Duerr 9974bc8baa
Fix cursor reflow
To make sure that output is consistent even while resizing the window,
the cursor will now reflow with the content whenever the window size is
changed.

Since the saved cursor is more likely to represent a position in the
grid rather than a reference to the content below it and handling of
resize before jumping back to it is more likely than with the primary
cursor, no reflow is performed for the saved cursor

The primary cursor is unfortunately always reflowed automatically by
shells like zsh, which has always caused problems like duplicating parts
of the prompt and stretching it out "infinitely". Since the cursor is
now reflowed appropriately the duplication of the shell prompt should be
reduced, however it is possible that the shell moves the cursor up one
line after it has already been reflowed, which will cause a line of
history to be deleted if there is no duplicated prompt line above the
reflowed prompt. Since this behavior is identical in VTE and Kitty, no
attempt is made to work around it in this patch.

Fixes #3584.
2020-07-09 05:16:20 +03:00
Christian Duerr 65bff1878f
Fix saved cursor handling
This resolves several problems with handling of the saved cursor when
switching between primary and alternate screen. Additionally ref-tests
are also added for all common interactions to make sure the behavior
does not regress.

The behavior is based on XTerm's behavior except for interaction with
`reset`. XTerm does not reset the alternate screen's saved cursor on
`reset`, but VTE does. Since a `reset` should reset as much as possible,
Alacritty copies VTE here instead of XTerm.
2020-07-06 19:10:06 +00:00
Christian Duerr 72c916ff43
Preserve linewrap flag across alt screen switches
While neither VTE, URxvt nor Kitty handle this, preserving the linewrap
flag across alternate screen switches seems like the correct thing to
do. XTerm also does handle this correctly, which indicates that it is a
bug and not a feature.
2020-07-06 05:08:36 +00:00
Andrew Zhou 466f95d3ba
Add auxiliary files to macOS Application bundle
Fixes #2653.
2020-07-04 14:03:48 +00:00
Jeff Windsor e1474a1e5f
Update --help for class option to match manpage 2020-07-04 09:13:32 +03:00
Christian Duerr bc60782e42
Fix reflow of empty wrapped cursor line
This bug was caused by trying to grow the terminal while the cursor line
was wrapped but entirely empty. Resizing the terminal now accounts for
the position of the deleted line and moves the cursor up only when the
line deleted was above it.

The deletion of the line was caused by the shell redrawing itself
whenever the cursor is moved.

Fixes #3583.
2020-07-01 09:58:06 +03:00
Carlo Abelli 8688e47ddb
Fix foreground dimming with truecolor text
Fixes #3766.
2020-06-29 00:07:16 +00:00
Kirill Chibisov 8a39346b75
Clear selection on clear line/screen escapes
Selection is now cleared if clear line or clear screen escape sequences
are clearing content behind it.
2020-06-26 16:04:55 +00:00
Christian Duerr 6c8966f426
Fix scroll down escape pulling lines from history
This works around a bug where the optimized version of the
`Grid::scroll_down` function would just rotate the entire grid down if
the scrolling region starts at the top of the screen, even if there is
history available.

Since rotations of scrolling regions should not affect the scrollback
history, this optimized version is now only called when the max
scrollback size is 0, making it impossible for the grid to have any
history while it is used.

Since the main usecase of this is the alternate screen buffer, which
never has any history, the performance should not be affected negatively
by this change.

Fixes #3582.
2020-06-25 09:50:17 +00:00
Christian Duerr 43c0ad6ea9
Add selection expansion
This allows for expanding the selection using the right mouse button.
The new selection type depends on the number of clicks and applies to
both sides of the selection.

Fixes #1554.
2020-06-23 12:57:15 +03:00
Christian Duerr 87e5b1aa25
Add automatic scrolling during selection
This adds a new `Scheduler` which allows for staging events to be
processed at a later time.

If there is a selection active and the mouse is above or below the
window, the viewport will now scroll torwards the direction of the
mouse. The amount of lines scrolled depends on the distance of the mouse
to the boundaries used for selection scrolling.

To make it possible to scroll while in fullscreen, the selection
scrolling area includes the padding of the window and is at least 5
pixels high in case there is not enough padding present.
2020-06-18 01:02:56 +00:00
Kirill Chibisov b15b476371
Rework default config binding replacement
This reworks the criteria necessary for default bindings to be
overwritten by custom user bindings. It should provide a better
heuristic which accounts for the possibility that notmodes are added
which prevent a conflict between the bindings, so the default isn't
unnecessarily removed.

It is still possible to define a new binding that intersects a default
binding without the default getting removed, if the user explicitly
specifies a mode that doesn't include the default binding's mode. This
is based on the assumption that users explicitly specifying a new mode
are trying to make a mode-specific addition and are capable of removing
the default when desired.

This helps with old modes still being present in user's config files,
since a lot of new config options just have the additional ~Vi mode set.

Fixes #3476.
2020-06-15 03:12:39 +03:00
Jade Michael Thornton 1e32e5a515
Fix font rendering regression on macOS
This fixes a regression introduced in
77f2d6e853.

Fixes #3809.
2020-06-04 20:24:09 +00:00
Christian Duerr e6475c6753
Add version 0.4.3 entries to changelog 2020-06-03 19:52:50 +00:00
Fernando e009869623
Add whitespace after dropped file paths
Fixes #3767.
2020-06-03 00:01:26 +00:00
David Hewitt c102e845cd
Add cargo feature for WinPTY 2020-06-02 21:31:06 +00:00
Christian Duerr 1dacc99183
Refactor Term/Grid separation
This commit aims to clear up the separation between Term and Grid to
make way for implementing search.

The `cursor` and `cursor_save` have been moved to the grid, since
they're always bound to their specific grid and this makes updating
easier.

Since the selection is independent of the active grid, it has been moved
to the `Term`.
2020-05-30 20:45:44 +00:00
Kirill Chibisov f7fb67f870
Update dependencies 2020-05-30 22:54:56 +03:00
Christian Duerr f1bf481eb8
Remove env_logger depedency
The env logger has been broken for over a year and is not used by anyone
as far as I know. This removes this option entirely in favor of
Alacritty's built-in logger level selection flags.
2020-05-29 06:22:16 +00:00
Kirill Chibisov a669f12793
Set IUTF8 input setting on supported platforms
Fixes #3769.
2020-05-27 18:24:01 +03:00
Kirill Chibisov 0f82817c03
Update copypasta to v0.7.0
Fixes #3592.
2020-05-21 01:22:39 +03:00
Christian Duerr 395fee2b01
Fix crash when writing wide char in last column
This resolves an issue where trying to write a fullwidth character in
the last column would crash Alacritty, if linewrapping was disabled.

Instead of assuming that the linewrap put after the linewrapping spacer
was successful, the character writing is now skipped completely when
trying to put a wide character in the last column.
2020-05-17 15:32:06 +00:00
Christian Duerr 922f48e52c
Bump winit to 0.22.2
Fixes #2601.
Fixes #2475.
2020-05-16 23:31:00 +00:00
Alexey Chernyshov 9a0eac0a14
Change default color scheme to 'Tomorrow Night'
Fixes #3404.
2020-05-16 22:27:31 +00:00
Kirill Chibisov 7ae701d57b
Add support for Fontconfig embolden and matrix options
Fixes #1754.
2020-05-14 04:25:11 +03:00
Christian Duerr b656fba35e
Fix OSCs terminated by \x9c byte in unicode
Fixes #3591.
2020-05-13 12:58:34 +03:00