aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty
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 all dependenciesChristian Duerr2024-11-02
| | | | | This patch applies all major and minor version bumps, with the exception of `unicode-width` since it will need to be handled separately for Unicode version 16.
* Remove startup notify variables only for shellKirill Chibisov2024-10-03
| | | | | | This will prevent issues when `setup_env` from `alacritty_terminal` will remove potentially useful variables for users of the library. Fixes #8202.
* 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.
* Make `ConPty` creation fallible张小白2024-08-16
|
* Fix spelling errorsJosh Soref2024-05-24
|
* Fix IO safety violation from consequent dropping `OwnedFd`Jakob Hellermann2024-05-23
| | | | This was not a _real_ violation and was _expected_, though for rust to not complain clone FD properly...
* Fix FD leak after closing child windowsChristian Duerr2024-05-22
| | | | | | | | This patch fixes an issue with signal handling where Alacritty would permanently create one signal handling FD for each alacritty window created by an instance. This FD was never released, causing a leak of the FD. Closes #7983.
* Ignore shell RCs for macOS zsh wrapperNathan Lilienthal2024-05-15
| | | Closes #7886.
* Add `from_file_descriptors()` to `tty::unix`Owen Law2024-05-01
|
* Allow setting terminal env vars via PTY optionsKirill Bulatov2024-03-18
| | | Closes #7778.
* 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.
* Set PTY's pixel size on startupKirill Chibisov2024-03-09
| | | | | 117719b3 removed the extra call for TIOCSWINSZ, however the initial `openpty` call itself did not set the pixel size, which caused issues with some clients.
* Send exit code events on child process exitKirill Bulatov2024-03-09
| | | | Fixes #7753.
* Expose more process info on WindowsSmall White2024-03-07
|
* Remove extra TIOCSWINSZ ioctl on startupKirill Chibisov2024-02-08
| | | | The openpty call already performs it, thus no need to call it one more with the exact same size since it confuses some applications.
* 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.
* Use openpty-rustix instead of nixKirill Chibisov2023-10-11
| | | | | | Follow upstream libraries and use rustix to reduce the amount of dependencies in the future. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Fix PTY being closed on creationKirill Chibisov2023-10-08
| | | | | The PTY got closed because `OwnedFd` automatically closed it. Fixes: 59c63d37 (Update dependencies)
* Update dependenciesChristian Duerr2023-10-08
| | | | This patch applies all breaking and non-breaking dependency updates and bumps MSRV to 1.70.0.
* 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.
* Unset `XDG_ACTIVATION_TOKEN` in alacritty_terminalKirill Chibisov2023-07-13
| | | This variable is what being used for Wayland's activation stuff.
* Add support for loading conpty.dllPavel Roskin2023-06-19
| | | | Co-Authored-By: @fredizzimo Co-Authored-By: @grueslayer
* Bump dependenciesPavel Roskin2023-06-11
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Update xdg and dirs crateKirill Chibisov2023-05-17
| | | | | | The recent version on xdg crate moved to home crate which is used by cargo. Thus to query for home directory we can use the home dependency instead which is smaller.
* Prefer environment variables over passwdJovan Gerodetti2023-02-02
|
* Fix startup failure on macOS with dash as /bin/shKirill Chibisov2022-10-22
| | | | | | The dash's exec doesn't have `-a` argument we rely on when running login shell, so use zsh instead. Fixes #6426.
* Migrate from winapi to windows-syskillian2022-09-30
|
* 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.
* Register Alacritty shells as tty sessions on macOSChris Copeland2022-07-24
| | | | | | | | | | | | | | | | | | Unless the `shell` config is specified, launch the user's shell with: ```sh login -flp $USER /bin/sh -c "exec -a -shell /path/to/shell" ``` On macOS, just running a shell prefixed by `-` is not sufficient to be registered as a login session for things like `w` and `logname`. However, using the `login` command changes the directory to `$HOME` before running the program by default, which is not desired. The `-l` flag disables this behavior, but also skips prepending `-` to the executed program, so shells will not run as login shells. Instead we just do this part ourselves with `exec -a`. The result is login shells that run in the intended directory and are registered as tty sessions. Fixes #3420.
* Remove panics from UNIX PTY initializationMikayla Maki2022-07-20
| | | Co-authored-by: Mikayla Maki <mikayla.c.maki@icloud.com>
* Replace `map().unwrap_or()` with `map_or()`Chris Copeland2022-07-20
| | | Use a `map_or` instead of a `map().unwrap_or()` chain.
* 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 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.
* 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.
* Update signal-hook to 0.3.10James McCoy2021-11-15
|
* 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.
* Remove unused struct fieldsChristian Duerr2021-09-15
| | | | | | While it might be nice to have the full `Passwd` struct around should anything ever change in the future, there's really no reason why Alacritty would need this information. So just removing things for now makes more sense than adding `#[allow(unused)]`.
* 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.
* Remove Windows WinPTY backendChristian Duerr2021-01-01
|
* Remove terminfo dependencyCaden Haustein2020-12-22
| | | | | Fixes #4597. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* 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>
* Disable WinPTY with windows-gnu toolchainMateusz Mikuła2020-08-31
| | | Co-authored-by: Christian Duerr <contact@christianduerr.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
|
* Fallback to SHELL instead of passwd if presentMattbazooka2020-07-14
| | | | | | | | | | | | | Instead of just always falling back to the shell specified in the passwd file when no config or cli shell was specified, Alacritty will not first look at the `$SHELL` environment variable. If this is unset, it will still read the passwd file. Since macOS is a bit peculiar and does not set the `$SHELL` environment variable by default, it is set manually to the shell used by Alacritty while any existing `$SHELL` variables are ignored. This matches the behavior of iTerm and Terminal.app. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* 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.
* 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.