aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
Commit message (Collapse)AuthorAge
...
* User timer based rendering instead of vsyncKirill Chibisov2022-12-30
| | | Fixes #824.
* Fix crash when one dimension of the window is zeroKirill Chibisov2022-12-30
| | | | | | This fixes a crash on Windows when the user resizes the window to the point that it has the height of zero. The crash was introduced by the glutin update, since it requires non-zero sizes for the resize.
* Fix cursor visibility with focus change on macOSChris Copeland2022-11-11
| | | Fixes #6452.
* Update glutin to 0.30.0Kirill Chibisov2022-11-03
| | | | | | | | | | | | | | | The glutin 0.30.0 update decouples glutin from winit which provides us with basis for a multithreaded renderer. This also improves robustness of our configuration picking, context creation, and surface handling. As an example we're now able to start on systems without a vsync, we don't try to build lots of contexts to check if some config works, and so on. That also brings us possibility to handle context losses, but that's a future work. Fixes #1268.
* Bump winit to 0.27.3Kirill Chibisov2022-09-15
| | | | Fixes #6324. Fixes #6313.
* Add IPC config subcommandChristian Duerr2022-09-01
| | | | | | | | | | | | | | | | | | | | This patch adds a new mechanism for changing configuration options without editing the configuration file, by sending options to running instances through `alacritty msg`. Each window will load Alacritty's configuration file by default and then accept IPC messages for config updates using the `alacritty msg config` subcommand. By default all windows will be updated, individual windows can be addressed using `alacritty msg config --window-id "$ALACRITTY_WINDOW_ID"`. Each option will replace the config's current value and cannot be reset until Alacritty is restarted or the option is overwritten with a new value. Configuration options are passed in the format `field.subfield=value`, where `value` is interpreted as yaml. Closes #472.
* Add inline input method supportKirill Chibisov2022-08-29
| | | | | | This commit adds support for inline IME handling. It also makes the search bar use underline cursor instead of using '_' character. Fixes #1613.
* Use `WindowEvent::Occluded` to hint renderingtrimental2022-08-11
| | | | This should prevent rendering on macOS and X11 to invisible windows.
* Bump glutin to 0.29.1Kirill Chibisov2022-08-10
| | | | | | | | Fixes #6239. Fixes #5975. Fixes #5876. Fixes #5767. Fixes #4484. Fixes #3139.
* Remove redundant dirty updatesKirill Chibisov2022-07-25
| | | | | | In some cases dirty was set without any ui update leading to extra redraws, this commit resolves this. Co-authored-by: Greg Depoire--Ferrer <greg@gregdf.com>
* Replace `map().unwrap_or()` with `map_or()`Chris Copeland2022-07-20
| | | Use a `map_or` instead of a `map().unwrap_or()` chain.
* Add support for hyperlink escape sequenceKirill Chibisov2022-07-10
| | | | | | | This commit adds support for hyperlink escape sequence `OSC 8 ; params ; URI ST`. The configuration option responsible for those is `hints.enabled.hyperlinks`. Fixes #922.
* Add `cursor.blink_timeout` config optionKirill Chibisov2022-07-01
| | | | | | This option should prevent extensive power usage due to cursor blinking when there's no user activity being performed. Fixes #5992.
* Fix resize on Wayland when creating new windowKirill Chibisov2022-06-29
| | | | | | | When we have currently active context when asking EGL on Wayland to create new context it'll lock the backing buffer of surface using that context. So making it non-current before-hand to prevent it. Follow-up to 90552e3.
* Fix Vi cursor not being damaged on scrollKirill Chibisov2022-05-26
| | | | | There's no need to damage intermediate Vi mode cursor points, since it can't change the terminal content meaning that only the previous and current vi cursor's viewport points matter to damage it properly.
* Don't inherit `--command` for `SpawnNewInstance`Kirill Chibisov2022-05-23
| | | Fixes #6060.
* Fix selection change after leaving vi-modea5ob7r2022-05-23
| | | | | | | | This patch fixes that the right point of the selection range moves to another point when leaves vi-mode with a selection by ToggleViMode. The cause is that always moves a vi-mode cursor to a search origin whether or not the current search is active. This problem is a regression which is introduced by #5945.
* Fix inaccurate method documentationAndrés Mejía2022-05-22
|
* Fix selection copy without button releasemahkoh2022-04-16
| | | | | | | | | | | | | | | To prevent the current selection clipboard from being overwritten right before pasting, text is no longer copied solely because the user scrolled the scrollback buffer. The selection also isn't copied when a mouse button other than LMB/RMB are released, since these are the only ones capable of modifying the selection range. This should prevent issues where the selection of the user gets unexpectedly overwritten, especially in scenarios where the user is currently in the process of pasting something into Alacritty. Signed-off-by: Julian Orth <ju.orth@gmail.com>
* Extract `SizeInfo` from alacritty_terminalKirill Chibisov2022-04-06
| | | | | The `SizeInfo` is a SizeInfo used for rendering, which contains information about padding, and such, however all the terminal need is number of visible lines and columns.
* Disallow OSC 52 for unfocused windowKirill Chibisov2022-04-03
| | | | | This leads to issues on macOS, since if we store clipboard at the same time it could error out. Also, on e.g. Wayland the clipboard store for unfocused window won't work anyway.
* Fix crash when searching during resetChristian Duerr2022-03-10
| | | | | | | | | | | | | | | | | | This fixes a crash which occurs when the terminal is reset while searching, due to the vi mode cursor being outside of the visible area. This also fixes an issue where the search state reset would incorrectly clamp the vi mode cursor to the grid, rather than the absolute viewport position. While this fix does resolve all crashes when searching while running `cat /dev/urandom`, it does raise the question if manually clamping the vi mode cursor in every location where it is modified is the right choice. A follow-up to provide a safer API which guarantees correct modification of the vi mode cursor location is probably a good idea. Fixes #5942.
* Don't load font twice during display creationKirill Chibisov2022-02-18
| | | | | This commit finishes the effort from a64553b to avoid reloading font twice during startup, since the original issue is with getting font metrics without building the glyph cache.
* Fix terminal damage after leaving Vi modeKirill Chibisov2022-02-02
| | | | This fixes an issue when search results were not damaged when leaving Vi mode.
* Add damage tracking and reporting to compatible compositorsKirill Chibisov2022-02-02
| | | | | | | | | | | | | | This allows compositors to only process damaged (that is, updated) regions of our window buffer, which for larger window sizes (think 4k) should significantly reduce compositing workload under compositors that support/honor it, which is good for performance, battery life and lower latency over remote connections like VNC. On Wayland, clients are expected to always report correct damage, so this makes us a good citizen there. It can also aid remote desktop (waypipe, rdp, vnc, ...) and other types of screencopy by having damage bubble up correctly. Fixes #3186.
* Add ´?´ support to OSC 4DaftMouse2022-01-15
|
* Don't blink when cursor is hiddenKirill Chibisov2022-01-11
| | | | This prevents unnecessary redraws when the terminal is idle, cursor is hidden and blinking is enabled.
* Fix title setting via IPC when dynamic_title is enabledKirill Chibisov2022-01-06
|
* Add title/class CLI parameters to create-windowKirill Chibisov2022-01-03
| | | | | This adds the ability to pass title and class over IPC via the create-window subcommand, so users can run only one instance for windows of different spurposes in the window managers of their choice.
* Fix CreateNewWindow CLI fallbackChristian Duerr2021-12-23
| | | | | | | | | | | | | | The existing behavior for the new CreateNewWindow actions was to always pass in their own options, which would discard the existing options configured on the terminal's PTY config. To fix this the behavior for CreateNewWindow is now the same as for the initial window creation, the config values are overwritten conditionally based on their individual presence in the CLI options. However all temporary CLI options set on the "master" Alacritty instance are discarded by all future windows. Fixes #5659.
* Remove shared PID/FD variablesChristian Duerr2021-12-19
| | | | | | | | | | | | | | | | The existing PID/FD atomics in alacritty_terminal/src/tty/unix.rs were shared across all Alacritty windows, causing problem with the new multiwindow feature. Instead of sharing these between the different windows, the master FD and shell PID are now stored on the `window_context`. Unfortunately this makes spawning new daemons a little more complicated, having to pass through additional parameters. To ease this a little bit the helper method `spawn_daemon` has been defined on the `ActionContext`, making it accessible from most parts of Alacritty's event loop. Fixes #5700.
* Spawn children from foreground working directoryJorge Carrasco2021-12-18
| | | | | | | | | To allow applications spawned by Alacritty to make use of the shell/foreground process' working directory, it is now set for all new processes spawned by Alacritty on Unix platforms. Fixes #5616. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Add parameters to `msg create-window` subcommandKirill Chibisov2021-11-22
| | | | | | | | | | | | | | | Alacritty's `msg create-window` subcommand would previously inherit all the CLI parameters from the original executable. However not only could this lead to unexpected behavior, it also prevents multi-window users from making use of parameters like `-e`, `--working-directory`, or `--hold`. This is solved by adding a JSON-based message format to the IPC socket messages which instructs the Alacritty server on which CLI parameters should be used to create the new window. Fixes #5562. Fixes #5561. Fixes #5560.
* Add multi-window supportChristian Duerr2021-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously Alacritty would always initialize only a single terminal emulator window feeding into the winit event loop, however some platforms like macOS expect all windows to be spawned by the same process and this "daemon-mode" can also come with the advantage of increased memory efficiency. The event loop has been restructured to handle all window-specific events only by the event processing context with the associated window id. This makes it possible to add new terminal windows at any time using the WindowContext::new function call. Some preliminary tests have shown that for empty terminals, this reduces the cost of additional terminal emulators from ~100M to ~6M. However at this point the robustness of the daemon against issues with individual terminals has not been refined, making the reliability of this system questionable. New windows can be created either by using the new `CreateNewWindow` action, or with the `alacritty msg create-window` subcommand. The subcommand sends a message to an IPC socket which Alacritty listens on, its location can be found in the `ALACRITTY_SOCKET` environment variable. Fixes #607.
* Update rustfmt configurationChristian Duerr2021-10-11
| | | | | | | | | | | | | | | | | In this change I went through all current rustfmt configuration options and expanded our existing configuration with overrides whenever deemed appropriate. The `normalize_doc_attributes` option is still unstable, but seems to work without any issues. Even when passing macros like `include_str!` that is recognized properly and not normalized. So while this wasn't an issue anywhere in the code, it should make sure it never will be. When it comes to imports there are two new major additions. The `imports_granularity` and `group_imports` options. Both mostly just incorporate unwritten rules that have existed in Alacritty for a long time. Unfortunately since `alacritty_terminal` imports in `alacritty` are supposed to be separate blocks, the `group_imports` option cannot be used.
* Fix incorrect vi mode search originChristian Duerr2021-09-28
| | | Fixes #5460.
* 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.