The previous implementation was relying on a column width of at least 1
to use an "optimized" unsafe implementation to initialize a row. Since
this optimization should not be necessary, there's no reason to
artificially limit our API with a hidden, undocumented column limit.
Alacritty was using a `Vec` without limits to store zerowidth
characters, making it possible to exhaust system memory by writing a
large number of these characters to a single cell.
Problem Example:
echo -en a; (while true; do echo -en '\xcc\x81'; done)
rect_for_line computed the rect's y with unsigned arithmetic. When the
window is small and the cell is tall, a damaged line can sit below what
fits in the viewport, so (line + 1) * cell_height exceeds y_top and the
subtraction underflows, panicking in debug builds.
The Rect is built from i32, so compute y as a signed subtraction and let
it go negative. overdamage already clamps the result back onto the
screen.
I think there's probably room for improving the representation of a lot
of these value in this area, but I'm not opening that can of worms right
now.
We ran in to a application-wide panic from an `assert` in the terminal,
this PR makes `set_nonblocking` fallible and propagates the error rather
than using an assert.
This adds a minimal pull request template to confirm compliance with
Alacritty's LLM policy before the PR is created.
The issue template is removed since GitHub has changed the format
(repeatedly) and the current version is no longer supported. We seem to
be doing fine without it.
This adds an override for the x11-clipboard dependency, which removed
the racy ownership check after writing text to the clipboard.
Closes#6978.
Signed-off-by: Daniel Müller <deso@posteo.net>
While likely a pointless addition, due to bad actors ignoring these
instructions anyway, this should clearly communicate the LLM
contribution preferences of the Alacritty project.
The text was copied from the Servo project with the detailed reasoning
stripped, since people that care are usually aware of the issues of LLMs
anyway.
This fixes two minor issues introduced in 96f488d.
The main problem was the fact that the I/O event polling on Unix was
only started when the IPC socket feature is enabled. While generally
this is the main reason why we need to shutdown cleanly, there's no
reason why we wouldn't *always* do so. This ensures the log file is
always cleaned up properly on Unix.
Another minor issue with the signal polling was that the pipe was
registered for reading, but never drained when it was ready to be read
from. While this would mean we're already in the process of shutting
down anyway, this would redundantly send about 1000 shutdown requests,
rather than just one.
This fixes an issue where Alacritty's resources, like its socket, would
stick around after getting killed, since termination signals like
SIGTERM were not handled explicitly.
To handle these signals, the IPC thread was changed to a general-purpose
I/O polling thread, listening for events on a signal pipe and the IPC
socket.
While this does not provide support for Windows, we also do not have an
IPC socket on Windows we would need to clean up.
Closes#8805.
The flash capability was using DECSCNM (ESC[?5h/ESC[?5l) to toggle
reverse video mode for a visual bell effect. However, the vte crate
does not implement DECSCNM (private mode 5), so the sequence is
ignored as an unknown mode.
Remove the capability from terminfo so programs can accurately
determine how to ring the user (e.g. by falling back to the audible
bell as vi does).
Those are block elements in 'Symbols for Legacy Computing' that
complements the ones from original block elements, but from the opposite
side.
Part-of: #7422.
This is a second attempt at 1399545.
The previous implementation tried to use mouse focus tracking to control
IME activity, which does not work since IME focus is unrelated to the
pointer.
This patch instead inhibits IME on the first touch sequence during focus
loss, forcing a touch tap before enabling IME again. This effectively
disables IME with the touch event used to focus the window, assuming the
compositor sends the touch down before the focus-in event.
To avoid the IME opening for a brief period of time while the window is
gaining focus again, we disable IME on focus loss, then reenable it once
focus is gained again. While this does theoretically change the behavior
with pointer input, it shouldn't impact usability since IME input
without keyboard focus isn't usually possibly anyway.
Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
Pointer events shouldn't disable IME in any way, however without them
touch doesn't really work in the current implementation, so revert it
for now to make review of the proper patch for touch easier.
This reverts commit 1399545f48.
It was suggest to try building both robust and non-robust as a fallback
due to 1.5 not mandating robustness, and also not mandating extension,
so the robustness can be supported, but without the extension present.
This reverts commit 7b33cbcbc2.
Previously whenever the user would use touch gestures to make selections
or scroll the terminal, IME would automatically be enabled due to the
focus change and reduce the terminal height. This isn't ideal when the
goal is just scanning through the terminal history without making any
input.
This patch keeps track of pointer and touch focus and only enables IME
when either the pointer is within the window or a tap touch sequence was
performed to give the window 'touch focus'.
The initial touch tap sequence used to enable IME is still forwarded to
the terminal as a simulated click event, since otherwise touch devices
without virtual keyboard would be forced into a confusing additional tap
to make it work. This means that virtual keyboard users will not be able
to open the virtual keyboard without creating a click event, which
should still be preferable to the status quo.
This disables the OpenGL context's robustness feature since some GPUs
that advertise robustness support do not support sufficient capabilities
for our implementation.
Closes#8713.
As this is practically the same as deleting the file it should be
treated the same and ignored.
Moving a file from somewhere to the config file is not ignored and the config
will reload as normal.
When the mouse cursor was hidden with `hide_when_typing` enabled, hints
could still be highlighted under the hidden cursor. This typically
occurred when a hint moved underneath the stationary, hidden cursor.
This fix ensures hints are not highlighted by the mouse cursor while
it's hidden.