aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
Commit message (Collapse)AuthorAge
* Add option to apply opacity to all background colorsKirill Chibisov2021-08-16
| | | | | | | In some cases it could be desired to apply 'background_opacity' to all background colors instead of just 'colors.primary.background', thus adding an 'colors.opaque_background_colors' option to control that. Fixes #741.
* Add ExpandSelection mouse binding actionJason Heard2021-07-29
| | | Fixes #4132.
* Fix search regressionsChristian Duerr2021-07-12
| | | Fixes #5315.
* Fix clippy warningsChristian Duerr2021-07-03
|
* Fix unnecessary redraws due to hint highlightingChristian Duerr2021-05-09
| | | | | | | | | | When the mouse cursor is moved by at least one cell, an update to the highlighted hints is triggered automatically. Previously this would always update the hints and redraw Alacritty regardless of the actualy change to the hint highlighting. By checking if the hint highlighting has actually changed, pointless redraws can be prevented. This is especially helpful since mouse motions often generate a lot of hint re-computations.
* Fix out of order terminal query responsesChristian Duerr2021-04-17
| | | | | | | | | | | | | This forces all responses made to the PTY through the indirection of the UI event loop, making sure that the writes to the PTY are in the same order as the original requests. This just delays all escape sequences by forcing them through the event loop, ideally all responses which are not asynchronous (like a clipboard read) would be made immediately. However since some escapes require feedback from the UI to mutable structures like the config (e.g. color query escapes), this would require additional locking. Fixes #4872.
* Fix selection flooding Wayland connectionChristian Duerr2021-04-17
| | | | | | | | | | This resolves an issue where an excessive clipboard update frequency would cause the Wayland display server to ignore necessary selection updates. Instead of copying the selection to the clipboard during the selection process, it is now only copied once the mouse button is released. Fixes #4953.
* Fix mouse point crash on resizeChristian Duerr2021-04-15
| | | | | | | | | This resolves an issue with Alacritty crashing after a resize, due to the last cached mouse point being out of bounds. Instead of caching the mouse point, it is now computed on demand to make sure it can never be invalid. Fixes #4977.
* Add hint action for moving the vi cursorChristian Duerr2021-04-15
| | | Fixes #4319.
* Add vi/mouse hint highlighting supportChristian Duerr2021-04-13
| | | | | This patch removes the old url highlighting code and replaces it with a new implementation making use of hints as sources for finding matches in the terminal.
* Add copy/paste/select hint actionsChristian Duerr2021-04-03
| | | | | | This adds some built-in actions for handling hint selections without having to spawn external applications. The new actions are `Copy`, `Select` and `Paste`.
* Unify the grid line indexing typesChristian Duerr2021-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously Alacritty was using two different ways to reference lines in the terminal. Either a `usize`, or a `Line(usize)`. These indexing systems both served different purposes, but made it difficult to reason about logic involving these systems because of its inconsistency. To resolve this issue, a single new `Line(i32)` type has been introduced. All existing references to lines and points now rely on this definition of a line. The indexing starts at the top of the terminal region with the line 0, which matches the line 1 used by escape sequences. Each line in the history becomes increasingly negative and the bottommost line is equal to the number of visible lines minus one. Having a system which goes into the negatives allows following the escape sequence's indexing system closely, while at the same time making it trivial to implement `Ord` for points. The Alacritty UI crate is the only place which has a different indexing system, since rendering and input puts the zero line at the top of the viewport, rather than the top of the terminal region. All instances which refer to a number of lines/columns instead of just a single Line/Column have also been changed to use a `usize` instead. This way a Line/Column will always refer to a specific place in the grid and no confusion is created by having a count of lines as a possible index into the grid storage.
* Add regex terminal hintsChristian Duerr2021-03-01
| | | | | | | | | | | | | | | | This adds support for hints, which allow opening parts of the visual buffer with external programs if they match a certain regex. This is done using a visual overlay triggered on a specified key binding, which then instructs the user which keys they need to press to pass the text to the application. In the future it should be possible to supply some built-in actions for Copy/Pasting the action and using this to launch text when clicking on it with the mouse. But the current implementation should already be useful as-is. Fixes #2792. Fixes #2536.
* Fix vi cursor after leaving searchChristian Duerr2021-02-26
| | | | | | | | | | This resolves an issue which caused the vi cursor position to be incorrect when leaving the search with the vi cursor at the far bottom. Previously this could lead to the vi cursor disappearing completely, when starting a vi mode search that has a match on the last line while the original vi mode cursor was right above it. Fixes #4833.
* Fix selection after search without matchChristian Duerr2021-02-22
| | | | | | | This resolves an issue where the last match would be selected after leaving non-vi search, even if further changes to the search regex did not result in any matches. Fixes #4831.
* Update dependenciesChristian Duerr2021-02-13
| | | | | | This introduces some duplicate dependencies, though they are necessary to build properly without any warnings. Fixes #4735.
* Fix segmentation fault on shutdown with WaylandChristian Duerr2021-01-29
| | | Fixes #4702.
* Fix damage tracking on WaylandChristian Duerr2021-01-27
| | | | | | | Since the Wayland event loop might delay rendering across event loop callback executions, it's necessary to track the global damage globally rather than just within a single loop execution. Fixes #4736.
* Move renderable cell transformation to alacrittyChristian Duerr2021-01-24
| | | | | | | | | | | | This refactors a large chunk of the alacritty_terminal API to expose all data necessary for rendering uniformly through the `renderable_content` call. This also no longer transforms the cells for rendering by a GUI but instead just reports the content from a terminal emulation perspective. The transformation into renderable cells is now done inside the alacritty crate. Since the terminal itself only ever needs to know about modified color RGB values, the configuration for colors was moved to the alacritty UI code.
* Fix debug mode crash in vi-less searchChristian Duerr2021-01-03
|
* Fix movement between matches in vi-less searchChristian Duerr2021-01-01
| | | | | | | | | | | | | | | This resolves various bugs related to vi-less search. The primary issue was that when jumping between matches more than 1000 lines apart, the search would get stuck and not advance between matches properly due to the 1000 line synchronous search limit. Some other issues related to the tracking of the search origin have also been fixed, improving the viewport positioning while interacting with the search outside of vi mode. This was done by keeping the search origin outside of the viewport, which allows for search to start right at the first character. Previously the search was on top of the first character which lead to it being excluded from search. Fixes #4626.
* Remove Windows WinPTY backendChristian Duerr2021-01-01
|
* Disable shadows for transparent windows on macOSChristian Duerr2020-12-22
| | | | | | | | | | | | Commit 5725f58 introduced a performance regression on macOS due to excessive calls to the `invalidateShadow` function, however calling this function only on redraw after a resize was performed does not fix the underlying problem. As a solution, window shadows are now disabled completely for all transparent windows. This makes sure there is no performance impact, while still solving the problem with text artifacts on resize. Fixes #4604.
* Replace serde's derive with custom proc macroChristian Duerr2020-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the existing `Deserialize` derive from serde with a `ConfigDeserialize` derive. The goal of this new proc macro is to allow a more error-friendly deserialization for the Alacritty configuration file without having to manage a lot of boilerplate code inside the configuration modules. The first part of the derive macro is for struct deserialization. This takes structs which have `Default` implemented and will only replace fields which can be successfully deserialized. Otherwise the `log` crate is used for printing errors. Since this deserialization takes the default value from the struct instead of the value, it removes the necessity for creating new types just to implement `Default` on them for deserialization. Additionally, the struct deserialization also checks for `Option` values and makes sure that explicitly specifying `none` as text literal is allowed for all options. The other part of the derive macro is responsible for deserializing enums. While only enums with Unit variants are supported, it will automatically implement a deserializer for these enums which accepts any form of capitalization. Since this custom derive prevents us from using serde's attributes on fields, some of the attributes have been reimplemented for `ConfigDeserialize`. These include `#[config(flatten)]`, `#[config(skip)]` and `#[config(alias = "alias)]`. The flatten attribute is currently limited to at most one per struct. Additionally the `#[config(deprecated = "optional message")]` attribute allows easily defining uniform deprecation messages for fields on structs.
* Add search history supportChristian Duerr2020-12-20
| | | | | | | | | | | | This adds a history to the regex search limited to at most 255 entries. Whenever a search is either confirmed or cancelled, the last regex is entered into the history and can be accessed when a new search is started. This should help users recover complicated search regexes after accidentally discarding them, or handle repeated searches with the same regexes. Fixes #4095.
* Add separate mode for search bindingsChristian Duerr2020-12-19
|
* Bump glutin to 0.26.0Kirill Chibisov2020-12-11
| | | | | Fixes #4530. Fixes #4072. Fixes #1927.
* Add blinking cursor supportDettorer2020-11-23
| | | | | | | | 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.
* Add ability to select text during searchChristian Duerr2020-11-13
| | | | | | | | | | | | | 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.
* Spawn new alacritty processes in CWD on macOSNathan Lilienthal2020-11-07
| | | | | | On macOS we can use 'proc_pidinfo' to determine the working directory of the terminal foreground process. Fixes #1979.
* Use dynamic storage for zerowidth charactersChristian Duerr2020-11-05
| | | | | | | | | | | | | | | | | | | 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.
* Fix visual bell getting stuckChristian Duerr2020-10-30
| | | | | | | | 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.
* Error on warnings when running clippyKirill Chibisov2020-10-29
| | | | | 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'.
* Fix incorrect X11 feature checkChristian Duerr2020-10-12
| | | See https://github.com/alacritty/alacritty/commit/721f789b5f98ab5c47e6e817c3c2228636ca0a1a#r43183826.
* Make use of glutin wayland/x11 featuresKirill Chibisov2020-10-12
| | | | This should allow users that are not using Wayland/X11 to reduce the resulted binary size and compilation times.
* Add support for urgency hints CSITaylor Blau2020-10-10
| | | | | | | | | | | | | | | | | | | | | | | Teach Alacritty to stop setting the window as urgent upon a bell by emulating xterm's 'bellIsUrgent' resource and relevant CSI. When this resource is enabled (with 'CSI ? 1042 h'), a bell event causes the window to be marked as urgent. When the resource is disabled (with 'CSI ? 1042 l'), the window is not marked urgent in the event of a bell. There are two wrinkles worth noting here: - The 'TermMode::URGENCY_HINTS' does _not_ affect the terminal's configured bell command, since we only want to control whether or not the window is marked as urgent, not anything else. - In xterm, the 'bellIsUrgent' resource is _disabled_ by default. Since bouncing the dock icon has been the default in Alacritty on macOS thus far, do not make an effort to change that in this patch. This allows users to emit "\e[?1042l" and disable bouncing the dock icon. Fixes #2950.
* Add support for single line terminalsii412020-09-27
| | | | | | | | | | | | | | | | | This changes the minimum terminal dimensions from 2 lines and 2 columns, to 1 line and 2 columns. This also reworks the `SizeInfo` to store the number of columns and lines and consistently has only the terminal lines/columns stored, instead of including the message bar and search in some places of the Alacritty renderer/input. These new changes also make it easy to properly start the selection scrolling as soon as the mouse is over the message bar, instead of waiting until it is beyond it. Fixes #4207. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Pass existing CLI parameters to SpawnNewInstanceRohan Poojary2020-09-06
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Add CLI parameter to override config optionsChristian Duerr2020-08-22
| | | | | | | | This uses the facilities added in 3c3e6870dedad56b270f5b65ea57d5a6e46b1de6 to allow overriding individual configuration file options dynamically from the CLI using the --options/-o parameter. Fixes #1258.
* Add configuration file importsChristian Duerr2020-08-21
| | | | | | | | | | | | | | | | | | | This adds the ability for users to have multiple configuration files which all inherit from each other. The order of imports is chronological, branching out to the deepest children first and overriding every field with that of the configuration files that are loaded at a later point in time. Live config reload watches the directories of all configuration files, allowing edits in any of them to update Alacritty immediately. While the imports are live reloaded, a new configuration file watcher will only be spawned once Alacritty is restarted. Since this might cause loops which would be very difficult to detect, a maximum depth is set to limit the recursion possible with nested configuration files. Fixes #779.
* Fix selection scrolling with message bar visibleChristian Duerr2020-08-14
| | | | | | | This resolves an issue with selection scrolling which would cause the selection to wrap to the top of the screen once the cursor enters the padding below the message bar. Fixes #4120.
* Fix clippy issuesChristian Duerr2020-08-06
| | | Co-authored-by: Kirill Chibisov <contact@kchibisov.com>
* Use `tcgetpgrp` to get PID for SpawnNewInstanceChristian Duerr2020-08-06
| | | Fixes #4082.
* Bump minimum supported Rust version to 1.43.0Kirill Chibisov2020-07-28
|
* Fix scrolling with selection expansionChristian Duerr2020-07-27
| | | Fixes #4040.
* Fix viless search originChristian Duerr2020-07-25
| | | | | | | | | | | | | When searching without vi mode the display is no longer reset when the user hasn't jumped between matches at all. Since there's no reason to confirm the search, we shouldn't just reset the viewport without a good reason. The search is now also restarted completely when the entire search regex is deleted. While this doesn't reset to the original viewport position if the user has jumped between matches, it should make things feel a little less arbitrary. Fixes #4020.
* Rename font crate to crossfontChristian Duerr2020-07-18
|
* Fix crashes during searchChristian Duerr2020-07-17
| | | | | | | | | | | | | | | | This fixes two crashes related to search. The first crash was due to variable shadowing computing the incorrect length of a search as soon as it was started, causing an overflow after attempting a subtraction. Since overflows are only debug mode checks, in release this would lead to an IME positioned far, far beyond the window's boundaries (likely offscreen). The other bug was that the search was always started from the last column in reverse search without vi mode, but after shrinking the terminal width that origin point is no longer a valid part of the grid. As a result it would cause an index out of bounds. The line was already clamped to the grid, but now the same is also done for the column. Fixes #3987.
* Add different search label for backward searchChristian Duerr2020-07-17
|
* Fix selection update in viless searchChristian Duerr2020-07-17
|