aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/event.rs
Commit message (Collapse)AuthorAge
* Ignore touch gestures for enabling IMEChristian Duerr2025-10-26
| | | | | | | | | | | | | | | | | | 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.
* Fix hint highlighting when hovering with hidden mouseskewb1k2025-09-01
| | | | | | | | 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.
* Add cooldown to bell command executionLukas Fink2025-08-17
| | | Closes #8655.
* Migrate to 2024 editionChristian Duerr2025-07-13
|
* Add multi-sequence touch zoom supportChristian Duerr2025-07-04
| | | | | This changes the way the touch zoom works by switching into a separate mode when one of the touch slots is removed, allowing continuous zoom as long as at least one slot is active.
* Remove cstr! macro in favor of literal notationKirill Chibisov2025-07-01
| | | | | Also apply clippy changes while at it. Closes #8002.
* Add IPC config retrieval subcommandChristian Duerr2025-05-29
| | | | | | | | | | | | | | | This patch adds a new `alacritty msg get-config` subcommand which can retrieve the current config from any Alacritty window using the IPC socket. The command will always print the full configuration file in JSON, without the ability to filter which values are returned, leaning on tools like `jq` instead of adding this complexity to Alacritty. Contrary to deserialization, this relies heavily on the default serialization implementations to reduce the necessary changes. Key and Mouse bindings are omitted entirely since their structure is very complex and they tend to just bloat the message size without having an obvious usecase.
* Fix clippy warningsKirill Chibisov2025-05-28
|
* Add * # { } vi motionsChristian Duerr2025-05-20
| | | | | | | | | | | | This patch adds Vi's semantic search and paragraph motion. The semantic search uses either the selection or the semantic word under the cursor and jumps to the next match in the desired direction. Paragraph motion jumps to just above or below the current paragraph. Closes #7961. Co-authored-by: Fletcher Gornick <fletcher@gornick.dev>
* Dont fail exec() on deleted directoriesTycho Andersen2025-02-08
| | | | | | | | | Use the `std::env::set_current_dir` from the `pre_exec` and ignore error, since not changing working directory is a side effect which shouldn't break spawning a program or block window creation. Signed-off-by: Tycho Andersen <tycho@tycho.pizza> Co-authored-by: Kirill Chibisov <contact@kchibisov.com> Co-authored-by: Christian Duerr <contact@christianduerr.com>
* 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
|