Age | Commit message (Collapse) | Author |
|
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.
|
|
It is now possible to configure the amount of lines
scrolled with faux scrollback.
|
|
Some people have complained about the behavior of faux scrollback inside
of vim/tmux, however from what I can tell, alacritty behaves the same
way as other terminal emulators that support faux scrollback.
However there are a lot of terminal emulators that do not support faux
scrollback at all, which leads to people complaining about unusual
scroll behavior.
This is my proposal on how to solve this issue, by giving people that do
not like the VTE-Style faux scrolling the option to opt-out.
|
|
Resolves #973
|
|
Cleanup cursor handling code and support wide cursors
|
|
Some terminals have functionality around changing the type of mouse
cursor dynamically (arrow and text) based on which mode(s) the VTE is
in. For example, gnome-terminal changes the cursor from text (default)
to an arrow when opening programs that track mouse events (e.g. vim,
emacs, tmux, htop, etc.). The programs all allow using the mouse
interactively under some circumstances (like executing `set mouse=a` in
vim).
The programs that use an interactive mouse set the terminal mode to
different values. Though they're not entirely the same terminal mode
across programs, an emulator like vte (the library gnome-terminal
implements), changes the mouse cursor if the mouse mode is one of the
following:
- 1000: Mouse Click Tracking
- 1001: Mouse Highlight Tracking
- 1002: Mouse Cell Motion Tracking
- 1003: Mouse All Motion Tracking
- 1004: Mouse Focus Tracking
See https://github.com/GNOME/vte/blob/6acfa59dfcceef65c1f7e3570db37ab245f049c4/src/vteseq.cc#L708
for more information.
This commit adds functionality that changes the winit/glutin
`MouseCursor` when a mouse-listening mode of 1000-1004 is set. It
behaves similarly to when the window title changes.
|
|
This logic is applied in Term's ansi::Handler implementation
to avoid unnecessary allocations.
|
|
This resolves the remaining issue of #842.
|
|
Moved the custom cursor block on ft to the top, so no unnecessary
operations are executed when trying to draw a custom cursor glyph.
|
|
Previously it was assumed that the font_key for the normal font is
always 0, because this assumption was a bit of a stretch, now the
font_key provided with the glyph is used. This is always the bold,
italics or normal font associated with the cell.
|
|
With linux every box, line or underline should now have the
pixel-perfect size with any font at any size.
This uses the default font to get the size of the monospace box. It
assumes that the face 0 is always the primary font, if this is not the
case, this will probably break.
|
|
|
|
Because some people have requested this change, the beam and underline
cursors now also transform into an empty box when the terminal loses
focus. Like this there is one unique symbol to indicate that a terminal
is not currently focused.
|
|
The ascent calculation on darwin was more complicated than it needed to
be. By running a `.ceil()` instead of adding one, checking if it's 0,
substracting if it is, and then flooring it, a few instructions could be
shaved off.
|
|
|
|
As requested a few comments have been added to the darwin code. There
also was an off by one error in the ascent calculation which has been
corrected.
The beam cursor width has also been tweaked to be slightly slimmer in
general.
All code added in this PR has also been run through the default rustfmt
to make sure the formatting is okay.
|
|
The macos target now also supports the custom beam and underline
cursors. The only thing left for this is now is testing and making sure
it works with tiny fonts.
|
|
In issue jwilm/asacritty#31 a few people complained about Beam cursor
being weird with their fonts, so to make all cursors uniform in
alacritty, a custom cursor has been added for the Beam too.
The beam cursor's height is always the full height of the monospace font
glyph bounding box. The width depends on the font size. It is calculated
using the width of the cell and dividing it by two. The block is always
aligned at the far-left of the cell.
The implementation is identical to the one of the underline cursor, but
it has been refactored so the glyphs are created in `lib.rs`, which can
be used by darwin/macos to implement these features too.
A small bug in the underline cursor has also been fixed, until now the
width was just using the width of the unicode character. Now it should
be using the full width of the monospace glyph bounding box with every
font.
Here are some screenshots for the Beam cursor:
![Small](https://u.teknik.io/v1QH3.png)
![Normal](https://u.teknik.io/RTlp2.png)
![Big](https://u.teknik.io/DLu2M.png)
![Huge](https://u.teknik.io/pSAFX.png)
|
|
|
|
The unicode character comment has been updated to correctly reference
the character instead of commenting on the variable that might be that
character.
|
|
Because rendering with macos works differently, the old underline cursor
is used for that. The cursor symbol has also been setup as a constant in
the font project.
|
|
As mentioned in jwilm/alacritty#931, it can be troublesome if a font has
an underline symbol outside of the glyph's bounding box. This can lead
to the underline disappearing at the bottom of the terminal.
As a solution a symbol from the private use area was used as the
character code for the underline symbol. Whenever this symbol is
encountered, instead of rendering it, a custom block is rendered.
In this implementation the block has the full character as width and
sits flush with the bottom of the glyph's bounding box. The height is
half the distance between the baseline and the bottom of the bounding
box.
|
|
|
|
|
|
|
|
|
|
|
|
Also fixes warning from gl generator
|
|
When a selection was made, the last line of the selection did not
include a new line character when the line ending was selected. This
would occur if only one line was selected; if multiple lines were
selected, only the final line did not include a newline.
This commit updates the `string_from_selection` function to attempt to
append a newline character in all places where they are suitable.
Because of the simplification of newline insertion, several trait
implementations were removed.
|
|
|
|
The cascade list is now generated from Menlo for all fonts. This doesn't
feel correct to me, but it seems to give the expected behavior on macOS.
One of the problems cited was that certain glyphs like ❯ would not be
rendered with default cascade lists for some fonts.
|
|
This became a support burden for me due to various compile and run time
issues.
|
|
Homebrew Rust will correctly compile `alacritty` now, and the monospace
font is automatically set to `Menlo` at first launch.
|
|
Void Linux has the alacritty package in the main repository's, so compilation from source isn't needed.
|
|
|
|
The pixel-based scrolling behavior has been adapted to be as similar to
the line-based one as possible.
I still have not been able to test this. But this should have a decent
chance to at least kinda work.
|
|
Touchpads which use line-based instead of pixel-based updates send
partial scroll requests, so decimal numbers are important. The current
implementation only really used scroll amounts that are either 1 or -1.
This has been fixed and now the line-based touchpads should have very
smooth scrolling, but the pixel-based approach is still WIP and
completely untested.
|
|
This patch implements faux scrolling inside the alternate screen buffer.
Whenever the user scrolls up or down while the alternate screen buffer
is active, instead of actual scrolling three up/down arrow keys are
inserted.
|
|
Previously there were two separate but intended-to-be-identical
implementations. Now the two implementations simply delegate to a
single, shared method. This should help correctness issues in the
future.
|
|
|
|
When an atlas is full and the `insert` call fails, a new atlas should be
created. This is the current strategy, however the atlas is put at the
end of the vector, but the `current_atlas` index is set to 0, instead of
the last element. This leads to a recursion where it keeps trying to
insert into the full atlas at position 0 instead of the new at
`atlas.len() - 1`.
With this simple fix a stack-overflow is prevented because the new atlas
is inserted as the first element, which then will be used correctly for
loading new glyphs.
This fixes jwilm/alacritty/issues/842 and might also solve
jwilm/alacritty/issues/914 (I wasn't able to reproduce this with the
latest master).
|
|
|
|
|
|
|
|
|