Age | Commit message (Collapse) | Author |
|
Macos doesn't provide their own strikeout metrics, so instead of using
the font metrics a fallback is used.
Since this seems to be stored separately on freetype too, there might be
a different way to get strikeout position and thickness (without CoreText)
|
|
To make sure the underline never goes beyond the cell bounds, a check
has been added.
Whenever an underline would normally be below the bottom line of the
cell, it is now placed `underline_thickness` above the bottom line. So
the position metric is ignored and the underline is rendered with the
correct thickness but right at the bottom of the cell.
|
|
With this change the strikeout should make proper use of the metrics in
the OS2 table. These metrics are available for all TTF and OTF fonts. If
the metrics are not supplied, a fallback strikeout based on underline
thickness and cell height is used.
To go in line with the metrics supplied by the OS2 table, the term of
`strikethrough` has been replaced with `strikeout` everywhere. I think
it makes sense to go forward with using `strikeout` in general when
talking about this.
There has also been a small bug where the cell would not be
underlined/striked out when an underline is broken over multiple lines.
This has been fixed and the underline/strikeout should always be applied
to each cell with this flag.
|
|
Until now the underline position and thickness has been used without
applying any scaling. However they are both specified in font units
which do not change with the font size.
To make sure the underline looks correct with every size of the font,
the thickness and position are now scaled by the `x_scale` stored in the
font metrics.
This does not fix strikethrough yet, even though it looks significantly
better, the implementation is still a hack.
To make sure the underline doesn't disappear with small fonts, the
minimum underline thickness has been set to `1`. This decision was made
because the `Hack` font has an underline thickness under `0.5` with
relatively big fonts.
This edge-case can lead to some odd behavior when making the font size
super tiny (smaller than readable) so just not rendering any underline
might be a viable alternative.
|
|
Line position has been reworked to be more accurate to freetype
specification.
However, the strikethrough position is not documented in freetype so a
weird hack has been chosen for now, further improving this depends on
getting an accurate underline first.
Underlines seem messed up because freetype is reporting a fixed
underline position no matter how big the font size. This can lead to the
underline leaving the glyph box with small fonts and a proportionally
tiny underline with big fonts.
|
|
|
|
Support for strikethrough has been added by inserting and removing a
`STRIKE_THROUGH` flag on the cell.
Now all strikethrough and underline drawing is also done through the
rectangle renderer. So no glyphs are used to render underlines and
strikethrough.
The position is taken from the font metrics and should be accurate for
linux, however is not yet tested on macos.
It works by checking the underline state for each cell and then drawing
from the start until the last position whenever an underline ended. This
adds a few checks even if no underline is rendered but I was not able to
measure any significant performance impact.
Fixes jwilm/alacritty#806.
Fixes jwilm/alacritty#31.
|
|
To make sure it is possible to draw over the complete window, the
viewport is removed before rendering rectangles now.
This makes the visual bell behave properly and flash over the padding of
the terminal too, instead of just flashing the grid.
However when rendering a rectangle now, the padding has to be taken into
consideration.
|
|
In preparation for potential other users of the rectangle drawing, a new
method has been added which moves all the setup and teardown outside of
the render_rect method.
This change will hopefully make it more efficient to draw loads of
rectangles in one frame and prevent excessive program swaps.
|
|
The abstraction for activating and deactivating shaders has been removed
because the single-line abstraction did not add much with a second
shader program added.
Because RectShaderProgram was added too, it required maintaining four
different methods for activating and deactivating shaders.
|
|
|
|
Instead of swapping shaders, now there are two programs kept around that
are swapped out when needed.
This has the benefit of skipping the expensive linking process that is
required after swapping the shaders on a program.
|
|
|
|
A method `render_rect` has been added that allows drawing a rectangle
over anything in the terminal. This is used by the visual bell to draw a
big rectangle over everything.
To achieve this a new shader has been added. Shaders are now kept around
until the program is dropped. Then whenever a rectangle draw call is
issued, the shader is swapped from the default shader to the rectangle
drawing shader.
After the shader has been swapped and the rectangle has been drawn,
uniforms (like projection) and blending function are reset to make sure
the rendering can be continued on the default shader.
All current instances of visual_bell in the rendering have been removed,
it is now all done exclusively through the rectangle rendering function.
Currently the shaders are swapped every time `render_rect` is called, so
when rendering multiple rectangles (potentially for underline /
strikethrough) there would be a loads of shader swaps that could be
potentially very expensive.
So before using `render_rect` for a different application, the shader
swap should be removed from the `render_rect` method.
As long as the visual bell's alpha value is 0, this has no effect on
performance because no rectangle is rendered.
|
|
This commit adds clippy as a required step of the build process. To make
this possible, all existing clippy issues have been resolved.
|
|
Until now alacritty completely refuses to start when the config is broken
in any way. This behavior has been changed so the worst-case is always
that alacritty launches with the default configuration.
When part of the config is broken, alacritty shouldn't instantly try to
recover to the default config, but instead try to use defaults only for
the parts of the config which are broken. This has also been implemented
for most of the fields in the configuration. So it should be possible that
parts are broken, but the rest is still used for the configuration.
This fixes #954.
|
|
This addresses the main feedback in jwilm/alacritty/pull/430. I've
decided to go from scratch instead of basing my work on top of what
markandrus has already implemented to keep it as simple as possible.
If there's any stuff that I should take from the other PR, please let me
know. I can also try to send a PR to markandrus.
|
|
|
|
|
|
|
|
fixes #1086
|
|
This cleans up a bunch of code.
|
|
Updated the lockfile to make sure clippy is building properly with the
latest nightly toolchain.
|
|
Updated the version of some dependencies.
This also changes to a new clippy version so clippy can work with the latest nightly compiler again. Some issues created by new lints have been fixed.
|
|
This should fix #1020, #710, and #902
|
|
Up to this point the `reset_state` method of the `Term` struct has been
just a placeholder. This has been changed and all important state has
been reset.
The only state that has not been reset is stuff which is retrieved from
the config and isn't stored as default on the `Term` struct either. From
what I can tell these are all never changed though.
This fixes jwilm/alacritty#1033.
After doing some more testing trying to figure out how to fix that all
glyphs are messed up after doing `cat /dev/urandom`, I was able to
confirm that resetting `Term::cursor` fixes the glyphs and restores
everything to normal.
So this also fixes jwilm/alacritty#804.
|
|
The lockfile has been updated to make clippy work with nightly again.
|
|
This change initially spawns alacritty as in invisible window, this
makes it possible for the pty to already access data like `window_id`
without having to wait for the window manager to actually open the
window.
Even though `GlWindow::new` is blocking when `with_visibility(true)` is
used, the `window.show` call is not blocking. So calling `GlWindow::new`
and `with_visibility(false)`, then immediately calling `window.show`
will create a window and make it visible instantly.
|
|
Clippy failed to build with the latest nightly, so the lockfile has been
updated to allow the nightly builds to work again.
|
|
A link to all variants available as `key` has been added to the key
bindings documentation, to help users with finding the right place
for mapping key codes.
|
|
Repeated uses of `cp -r target/release/osx/Alacritty.app
/Applications/Alacritty.app` will result in copying Alacritty.app to
`/Applications/Alacritty.app/Alacritty.app`.
|
|
|
|
Commit 2920cbe7103f03a45080bfb7610bd7f481f36361 introduced a regression because of a typo in the chunk slice index for the `parse_rgb_color` call.
This fixes this issue by resetting it to the state it was before the faulty commit.
|
|
|
|
When pasting in non-bracketed more, all line endings (including
DOS-style CRLFs) get normalized to a single CR to simulate a keypress of
the <return> key.
|
|
When pasting in non-bracketed mode, LFs are replaced with CRs.
|
|
|
|
There were two bugs fixed in this commit:
1. `sgr_mouse_report` was not always called when `SGR_MOUSE` bit was set
due to calling `normal_mouse_report` instead of `mouse_report` in the
scrolling method.
2. SGR reporting was always going off the left mouse button state rather
than what was appropriate. This affected SGR scroll reporting since
it only behaves correctly for pressed events (final character 'M').
Resolves #698.
|
|
This commit adds clippy as a required step of the build process. To make
this possible, all existing clippy issues have been resolved.
|
|
Until now alacritty completely refuses to start when the config is broken
in any way. This behavior has been changed so the worst-case is always
that alacritty launches with the default configuration.
When part of the config is broken, alacritty shouldn't instantly try to
recover to the default config, but instead try to use defaults only for
the parts of the config which are broken. This has also been implemented
for most of the fields in the configuration. So it should be possible that
parts are broken, but the rest is still used for the configuration.
This fixes #954.
|
|
This replaces the `font_size_modifier` stored on the `Term` struct with a `font_size` field.
With this change it is not necessary anymore to calculate the new font size from a delta but the current font size is always stored directly on the `Term` struct.
As a result of this it is now possible to increase the font size by more than 127 steps at runtime. It also limits the minimum font size to 1, so issues with the `font_size_modifier` dropping far below font size 1 are resolved with this change.
This fixes #955.
|
|
|
|
ModifiersState is now passed to the mouse methods in `input.rs` as a
whole instead of just passing the `shift` state. This should make it a
bit easier to do changes in the future.
|
|
It seems like the common consensus is that even in mouse mode, the
selection should be cleared with a normal click.
If there is any reason why this should not be the case, please let me
know.
|
|
The tests were using a manually setup `ModifiersState`, to clean things
up a bit the `ModifiersState::default` method has been used to replace
this.
|
|
Three was still a test which passed the whole modifiers struct instead
of just the shift bool, this has been fixed.
|
|
The only mouse modifier required right now is the shift key, to prevent
passing around unnecessary state, only the shift state is passed to the
mouse processors now.
|
|
When an application takes control over the mouse, it usually disables
selection completely. However the common way to still make selection
possible is by allowing selection while the shift key is held down.
This feature is implemented here by making use of the new `modifiers`
field on mouse events with glutin/winit.
This fixes jwilm/alacritty#146.
|
|
This allows e.g. tmux to set the clipboard via the OSC 52 escape code.
|
|
The config documentation has been changed to make it clear which part of
the documentation is related to which setting.
The faux scrollback part of the `scroll_terminal` method has been
cleaned up by making use of the fact that the `codepoint + 1` can be
used in the escape sequence which is used for scrolling.
|