aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/event_loop.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`.
* Bump VTE to 0.14.0Christian Duerr2025-01-09
| | | | Since this is a breaking change, it also bumps the alacritty_terminal development version to 0.25.0-dev.
* Fix hint `Select` action for hyperlink escapeChristian Duerr2024-03-12
| | | | | | | | | | | | This fixes an issue where the `Select` action for hyperlink escape text would select the entire line, instead of selecting only the hyperlink itself. It also changes the way hyperlinks with the same ID are highlighted, removing the restriction of being on consecutive lines and instead highlighting all visible cells that correspond to the matching hyperlink. Closes #7766.
* Send exit code events on child process exitKirill Bulatov2024-03-09
| | | | Fixes #7753.
* Fix unnecessary explicit panic in PTY Conrad Irwin2024-02-02
| | | Closes #7680.
* Passthrough potential errors for `EventLoopSender`Hyper2023-12-30
|
* Derive `Clone` for `EventLoopSender`Hyper2023-12-28
|
* 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.
* Port from mio to pollingJohn Nunley2023-10-07
| | | | | | | | | This patch replaces the mio crate with the polling. Now that smol-rs/polling#96 has been merged, we should be at full feature parity with mio v0.6 now. Fixes #7104. Fixes #6486.
* Switch to VTE's built-in ansi featureAnhad Singh2023-05-23
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Update winit to 0.28Kirill Chibisov2023-02-02
| | | | | | | | Fixes #6644. Fixes #6615. Fixes #6558. Fixes #6515. Fixes #3187. Fixes #62.
* Fix a few minor clippy lintsYuri Astrakhan2022-06-02
|
* 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.
* Remove outdated Rust compatibility codefee1-dead2021-12-17
|
* Fix libxkbcommon-devel package name for openSUSEDiego Garza2021-11-02
| | | Fixes #5586.
* 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.
* Handle PTY EIO error for Rust 1.55+Ilya Bobyr2021-09-19
| | | | | | | | | `ErrorKind::Other` no longer includes `EIO` since Rust 1.55: https://blog.rust-lang.org/2021/09/09/Rust-1.55.0.html#stdioerrorkind-variants-updated It was not precise enough from the very beginning, as the comment says that only EIO should be hidden, while the code was any uncategorised errors.
* Fix PTY performance regressionsChristian Duerr2021-07-08
| | | | | | | | | | | | | | | | | | The patch 9e7655e introduced some changes which improved rendering with very dense grids, but the automatic benchmarks indicated a slight performance difference in the `dense_cells` benchmark. Caching the terminal lock between iterations rather than always calling `try_lock` resolves that issue. While breaking early in the `WouldBlock` case with `unprocessed != 0` does also help resolve these issues, it shows some more significant fluctuations. Combining both fixes does not help. Additionally on Windows receiving `Ok(0)` from the PTY will also occur instead of a `WouldBlock` error, so handling that fixes freezing on Windows. Fixes #5305.
* Add buffer for PTY reads during terminal lockChristian Duerr2021-07-03
| | | | | | | | | | | | | | | | | | | | Before this patch, Alacritty's PTY reader would always try to read the PTY into a buffer and then wait for the acquisition of the terminal lock to process this data. Since locking for the terminal could take some time, the PTY could fill up with the thread idling while doing so. As a solution, this patch keeps reading to a buffer while the terminal is locked in the renderer and starts processing all buffered data as soon as the lock is released. This has halfed the runtime of a simple `cat` benchmark from ~9 to ~4 seconds when the font size is set to `1`. Running this patch with "normal" grid densities does not appear to make any significant performance differences in either direction. One possible memory optimization for the future would be to use this buffer for synchronized updates, but since this currently uses a dynamic buffer and would be a bit more cluttered, it has not been implemented in this patch.
* 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.
* 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`.
* Add support for synchronized updatesChristian Duerr2021-02-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements support for temporarily freezing the terminal grid to prevent rendering of incomplete frames. This can be triggered using the escapes `DCS = 1 s` (start) and `DCS = 2 s` (end). The synchronization is implemented by forwarding all received PTY bytes to a 2 MiB buffer. This should allow updating the entire grid even if it is fairly dense. Unfortunately this also means that another branch is necessary in Alacritty's parser which does have a slight performance impact. In a previous version the freezing was implemented by caching the renderable grid state whenever a synchronized update is started. While this strategy makes it possible to implement this without any performance impact without synchronized updates, a significant performance overhead is introduced whenever a synchronized update is started. Since this can happen thousands of times per frame, it is not a feasible solution. While it would be possible to render at most one synchronized update per frame, it is possible that another synchronized update comes in at any time and stays active for an extended period. As a result the state visible before the long synchronization would be the first received update per frame, not the last, which could lead to the user missing important information during the long freezing interval. Fixes #598.
* Update dependenciesChristian Duerr2021-02-13
| | | | | | This introduces some duplicate dependencies, though they are necessary to build properly without any warnings. Fixes #4735.
* 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.
* Fix draining of PTY when holding on exitChristian Duerr2020-12-17
| | | Fixes #4189.
* Bump minimum supported Rust version to 1.43.0Kirill Chibisov2020-07-28
|
* Remove gui dependencies from alacritty_terminalKirill Chibisov2020-07-11
| | | | | | | | This commit removes font dependency from alacritty_terminal, so it'll simplify the usage of alacritty_terminal as a library, since you won't link to system's libraries anymore. It also moves many alacritty related config options from it. Fixes #3393.
* Add option to run command on bell Kirill Chibisov2020-07-10
| | | Fixes #1528.
* Remove copyright notice from filesChristian Duerr2020-06-06
| | | | | | | | | | | | | | Keeping the license as part of every file bloats up the files unnecessarily and introduces an additional overhead to the creation of new modules. Since cargo already provides excellent dependency management, most of the code-reuse of Alacritty should occur through Rust's dependency management instead of copying it source. If code is copied partially, copying the license from the main license file should be just as easy as copying from the top of the file and making some adjustments based on where it is used is likely necessary anyways.
* Extend style guideline documentationChristian Duerr2020-05-05
|
* Send PTY resize messages through event loopDavid Hewitt2019-12-14
| | | | | | | This allows us to clean up the Arcs on windows, as well as tidy up the code on unix a little too. Fixes #3086.
* Fix WinPTY freeze on terminationMaciej Makowski2019-11-16
| | | Fixes #2889.
* Add --hold CLI flagValentin Ignatev2019-10-09
| | | | | | This implements --hold flag which keeps Alacritty open after its child process exits. Fixes #1165.
* Update to winit/glutin EventLoop 2.0Christian Duerr2019-10-05
| | | | | | | | | | | | | | | | | | | | | | | | | This takes the latest glutin master to port Alacritty to the EventLoop 2.0 rework. This changes a big part of the event loop handling by pushing the event loop in a separate thread from the renderer and running both in parallel. Fixes #2796. Fixes #2694. Fixes #2643. Fixes #2625. Fixes #2618. Fixes #2601. Fixes #2564. Fixes #2456. Fixes #2438. Fixes #2334. Fixes #2254. Fixes #2217. Fixes #1789. Fixes #1750. Fixes #1125.
* Remove outdated TODO/FIXME commentsChristian Duerr2019-09-21
|
* Split alacritty into a separate cratesTheodore Dubois2019-04-28
The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.