aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
Commit message (Collapse)AuthorAge
* Add option to drain PTY on shutdownAndrew Borg (Kashin)2025-01-16
| | | | | This patch removes the `hold` option on `alacritty_terminal` in favor of a `drain_on_exit` option, which will drain the PTY before shutdown. The hold logic is instead handled in `alacritty`.
* Don't switch semantic/line selection when control is pressedKirill Chibisov2024-12-29
| | | | Changing block selection to regular semantic one doesn't feel intuitive, thus don't switch to it when user has control pressed.
* Fix window options for initial daemon windowChristian Duerr2024-12-22
| | | | | | | | This fixes an issue with daemon mode where the first spawned window would not use the window options passed to the `create-window` subcommand, but would instead use the options passed during creation of the original daemon. Closes #8371.
* Fix racing condition in hint triggeringChristian Duerr2024-11-02
| | | | | | | | | | | This fixes an issue with hints where it was possible that the terminal content of highlighted hints changed between the highlighted hint update and the activation of the hint. This patch always validates the hint's text content against the hint itself to ensure that the content is still valid for the original hint which triggered the highlight. Closes #8277.
* Add headless modeChristian Duerr2024-10-15
| | | | | | | | This patch adds a daemon mode to Alacritty which allows starting the Alacritty process without spawning an initial window. While this does not provide any significant advantage over the existing behavior of always spawning a window, it does integrate nicer with some setups and is a pretty trivial addition.
* Add IME support to inline searchChristian Duerr2024-10-15
| | | | | | | | | | | This changes the behavior of inline search from only accepting direct key inputs, to also accepting IME and paste. The additional characters are still being discarded, matching the existing behavior. This also fixes an issue where inline search wouldn't work for characters requiring modifiers, since the modifier press was interpreted as the search target instead. Closes #8208.
* Implement multi-char cursor highlightKirill Chibisov2024-10-15
| | | | | | | | Use `end` of the cursor to draw a `HollowBlock` from `start` to `end`. When cursor covers only a single character, use `Beam` cursor instead of `HollowBlock`. Fixes #8238. Fixes #7849.
* Move root config fields to `[general]` sectionChristian Duerr2024-10-02
| | | | | | | | | | | Some users struggle with TOML, since root options must always be at the top of the file, since they're otherwise associated with the last table. To avoid misunderstandings, all root-level fields have been removed. A new `general` section was added to allow housing configuration options that do not fit into any more specific groups. Closes #7906.
* Ignore cursor color request with default colorsChristian Duerr2024-09-22
| | | | | | | | | | | | Currently when the cursor colors are requested for the default cursor color, Alacritty always responds with #000000. Since this is most likely incorrect, this response is misleading. Realistically there's very little reason why any application would need to know the color of the (often dynamically changing) default cursor. So instead of always reporting an incorrect black value, this patch just stops reporting values unless the cursor color was explicitly changed. Closes #8169.
* Restart config monitor on import changeChristian Duerr2024-07-21
| | | | | | | This patch checks the hash of the import paths on every config change and restarts the config monitor whenever the current monitor's hash diverges from the updated config's list of imports. Closes #7981.
* Bump glutin to 0.32.0Kirill Chibisov2024-06-08
|
* Fix spelling errorsJosh Soref2024-05-24
|
* Fix user events for all windows not handledKirill Chibisov2024-05-07
| | | | | | The user events for all cases were not handled. Fixes: 48c088a5 (Bump winit to 0.30.0) Fixes: #7957.
* Bump winit to 0.30.0Kirill Chibisov2024-05-04
|
* Fix dynamic title override for multiple windowsChristian Duerr2024-04-23
| | | | | | | | | | | This fixes an issue where Windows spawned after the initial one through IPC or bindings would not update their title due to the initial window having its title set through the CLI. Title changes are still inhibited for additional windows when they are spawned through `alacritty msg create-window` with the `--title` CLI option added. Closes #6836.
* Send exit code events on child process exitKirill Bulatov2024-03-09
| | | | Fixes #7753.
* Fix clippy warningsChristian Duerr2024-02-14
|
* Don't substitute `\n` in char bindingsKirill Chibisov2023-12-30
| | | | | | This broke unintentionally due to routing paste-like input via paste function. Fixes #7476.
* Bump crossfont to 0.7.0Kirill Chibisov2023-12-14
|
* Update to crossfont 0.6.0Kirill Chibisov2023-12-08
|
* Damage only terminal inside `alacritty_terminal`Kirill Chibisov2023-11-23
| | | | | | | | | | | | The damage tracking was including selection and vi_cursor which were rendering viewport related, however all the damage tracking inside the `alacritty_terminal` was _terminal viewport_ related, meaning that it should be affected by `display_offset`. Refactor the damage tracking so `alacritty_terminal` is only tracking actual terminal updates and properly applying display offset to them, while `alacritty` pulls this damage into its own UI damage state. Fixes #7111.
* Fix Vi cursor not being dirty when scrollingKirill Chibisov2023-11-14
|
* Add `--option` argument to `create-window`Christian Duerr2023-11-11
| | | | | | | | | | | | This patch adds a new CLI parameter to the `create-window` subcommand, matching the existing `--option` parameter when creating a new Alacritty instance. This parameter allows setting up the initial window configuration from the CLI without having to call `alacritty msg config`, making sure that all options are set appropriately right from the start. Closes #6238.
* Unify CLI config override mechanismsChristian Duerr2023-11-11
| | | | | | | | | This patch changes the way the `-o` config option works when specified at startup to function the same way as the IPC mechanism. While this should technically perform the exact same way, it should hopefully make it a little easier to understand how CLI config replacement works.
* Fix cursor being hidden after reaching timeoutKirill Chibisov2023-11-10
| | | | The timeout and blink events could be delivered at the same time, so canceling blinking won't work and we'll still have an event.
* Remove `alacritty_config` from alacritty_terminalKirill Chibisov2023-11-10
| | | | | There's no need to force alacritty's user configuration on other users of the crate, thus provide the options actually used by alacritty_terminal itself.
* Fix crash when leaving search after resizeChristian Duerr2023-11-03
| | | | | | | This fixes a crash which could occur when leaving search with a visible match after shrinking the terminal height to be lower than the original line the focused match was in. Closes #7054.
* Fix typosPavel Roskin2023-10-25
|
* Fix crash due to wrong drop order of clipboardKirill Chibisov2023-10-23
| | | Fixes #7309.
* Update winit to 0.29.2 and copypasta to 0.10.0Kirill Chibisov2023-10-21
| | | | | | | | | Fixes #7236. Fixes #7201. Fixes #7146. Fixes #6848. Fixes #3601. Fixes #3108. Fixes #2453.
* Add inline vi mode searchChristian Duerr2023-10-20
| | | | | | This patch adds inline search to vi mode using `f`/`F` and `t`/`T` as default bindings. The behavior matches that of vim. Fixes #7203.
* Fix regex memory usageChristian Duerr2023-09-17
| | | | | | | | | | | | | | | | | | This fixes an issue where regexes with a large number of possible states would consume excessive memory, since the entire DFA was compiled ahead of time. To solve this, the DFA is now built at runtime using `regex-automata`'s hybrid DFA. There are however still some checks performed ahead of time, causing errors with obscenely large regexes (`[0-9A-Za-z]{999999999}`), which shouldn't cause any issues. A regex which is large, but not large enough to fail the NFA construction (like `[0-9A-Za-z]{999999}`) will cause a long search of the entire grid, but will complete and show the match. Closes #7097.
* Add bindings for macOS tabsKirill Chibisov2023-09-04
| | | | | This doesn't represnet the movement to add tabs on any other platform, unless winit could add a similar API for them.
* Update winit to 0.29.1-betaKirill Chibisov2023-09-04
| | | | | | | | Make use of new winit frame throttling mechanism used in RedrawRequested, which removes the need for having Wayland queue to ask for the frame callbacks. Fixes #7011.
* Copy global IPC options for new windowsChristian Duerr2023-08-08
| | | | | | | | | This patch stores all options set for the Window ID `-1` and automatically applies them to new windows after their creation. This in theory makes it possible to have a fully dynamic "default config" without having to reapply it for every new window. Closes #7128.
* Use ahash instead of fnv and regular hash functionKirill Chibisov2023-07-24
| | | | | | | | After evaluation of the ahash with the data alacritty uses it was discovered that it's 1.5-2x times faster when getting the already hashed values, which is the primary cases for alacritty's renderer. Given that ahash is generally faster, all the HashSet and HashMap's inside the alacritty were changed to use it as a hasher function.
* Use bracketed paste only for multi-char IME inputKirill Chibisov2023-07-20
| | | | Some IME setups do only `commit` single char input, like fcitx5 when doing ru input.
* Update to the new winit keyboard APIKirill Chibisov2023-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main highlight of this update is that alacritty will now use new keyboard API from the winit, which resolves a lot of issues around key bindings, such as ability to bind dead keys. It also fixes long standing issues with the virtual key code bindings and make bindings in general more predictable. It also makes our default Vi key bindings fully working. Given that alacritty was using `VirtualKey` directly in the bindings from the winit, and winit simply removed the enum, we've added internal conversions to minimize the fallout, but new way to specify the bindings should be more intuitive. Other part of this update fixes some forward compatibility bugs with the Wayland backend, given that wayland-rs 0.30 is fully forward compatible. The update also fixes weird Maximized startup issues on GNOME Wayland, however they were present on any sane compositor. Fixes #6842. Fixes #6455. Fixes #6184. Fixes #5684. Fixes #3574. Fixes #3460. Fixes #1336. Fixes #892. Fixes #458. Fixes #55.
* Fix crash on ScaleFactorChange on WindowsKirill Chibisov2023-06-02
| | | | | | | Windows is known to send zero sizes from winit in Risezed and now in ScaleFactorChanged events. They were handled in Resized, but not in ScaleFactorChanged. Fixes #6949.
* Omit urgency hint focused windowKirill Chibisov2023-04-15
|
* Allow mode-exclusive bindings in any modeChristian Duerr2023-04-15
| | | | | | This patch enables binding chains that go beyond mode changes by allowing bindings to be defined for modes they do not usually have an effect in.
* Use paste for ESC action and IME commitChristian Duerr2023-04-15
| | | | | | Route string terminal input through 'ActionContext::paste' instead of char by char write improving performance by utilizing bracketed paste mode when it's reasonable.
* Reset char suppression for every key bindingChristian Duerr2023-04-15
| | | | | | | | | | Previously the character suppression was only reset whenever a key was released. However this did not take key repetition into account. Now every key down also resets the character suppression. This should work since the `ReceivedCharacter` is always received immediately after the `KeyboardInput` without the chance of a racing condition where another keyboard event interrupts the two.
* Fix selection rotation on the last lineChristian Duerr2023-03-24
| | | | | | | | | | | | | This fixes an issue with terminal resizes when the selection is on the last line. Alacritty would fail to rotate lines and keep the selection in the same line index whenever the terminal line count was grown or shrunk. This issue occurred due to the range passed to the selection's rotate function still being based on the old terminal size, which caused the initial or target state of the rotation to be outside of the terminal bounds. Closes #6698.
* Fix busy rendering when the same warning persistsKirill Chibisov2023-03-02
| | | | | | When the same warning is thrown on the each rendering iteration, it'll force alacritty to always render. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Send D&D input through paste actionChristian Duerr2023-02-27
| | | | Treating D&D like paste allows using D&D to input text into areas other than the PTY, like the search bar.
* Fix bracketed paste with EOT payloadChristian Duerr2023-02-23
| | | | | This works around an issue in many (all?) shells where the bracketed paste logic would only strip out `\r` but interpret EOT (`\x03`) as a termination of the bracketed paste.
* Add touch input supportChristian Duerr2023-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch builds upon the prior work by @4z3 and @bytbox to add touchscreen support to Alacritty. While some inspiration was taken from @4z3's patch, it was rewritten from scratch. This patch supports 4 basic touch interactions: - Tap - Scroll - Select - Zoom Tap allows emulating the mouse to enter a single LMB click. While it would be possible to add more complicated mouse emulation including support for RMB and others, it's likely more confusing than anything else and could conflict with other more useful touch actions. Scroll and Select are started by horizontal or vertical dragging. While selection isn't particularly accurate with a fat finger, it works reasonably well and the separation from selection through horizontal and vertical start feels pretty natural. Since horizontal drag is reserved for selection we do not support horizontal scrolling inside the terminal. While it would be possible to somewhat support it by starting a selection with vertical movement and then scrolling horizontally afterwards, it would likely just confuse people so it was left out. Zoom is pretty simple in just changing the font size when a two-finger pinch gesture is used. Performance of this is pretty terrible especially on low-end hardware since this obviously isn't a cheap operation, but it seems like a worthwhile addition since small touchscreen devices are most likely to need frequent font size adjustment to make output readable. Closes #3671.
* Update winit to 0.28Kirill Chibisov2023-02-02
| | | | | | | | Fixes #6644. Fixes #6615. Fixes #6558. Fixes #6515. Fixes #3187. Fixes #62.
* Add support for horizontal scrollingKirill Chibisov2023-01-16
| | | | | | This adds support for horizontal mouse scrolling in mouse mode and alternative scrolling modes. Fixes #2185.