aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty
AgeCommit message (Collapse)Author
2024-11-02Bump all dependenciesChristian Duerr
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.
2024-10-03Remove startup notify variables only for shellKirill Chibisov
This will prevent issues when `setup_env` from `alacritty_terminal` will remove potentially useful variables for users of the library. Fixes #8202.
2024-10-02Move root config fields to `[general]` sectionChristian Duerr
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.
2024-08-16Make `ConPty` creation fallible张小白
2024-05-24Fix spelling errorsJosh Soref
2024-05-23Fix IO safety violation from consequent dropping `OwnedFd`Jakob Hellermann
This was not a _real_ violation and was _expected_, though for rust to not complain clone FD properly...
2024-05-22Fix FD leak after closing child windowsChristian Duerr
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.
2024-05-15Ignore shell RCs for macOS zsh wrapperNathan Lilienthal
Closes #7886.
2024-05-01Add `from_file_descriptors()` to `tty::unix`Owen Law
2024-03-18Allow setting terminal env vars via PTY optionsKirill Bulatov
Closes #7778.
2024-03-12Fix hint `Select` action for hyperlink escapeChristian Duerr
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.
2024-03-09Set PTY's pixel size on startupKirill Chibisov
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.
2024-03-09Send exit code events on child process exitKirill Bulatov
Fixes #7753.
2024-03-07Expose more process info on WindowsSmall White
2024-02-08Remove extra TIOCSWINSZ ioctl on startupKirill Chibisov
The openpty call already performs it, thus no need to call it one more with the exact same size since it confuses some applications.
2023-11-10Remove `alacritty_config` from alacritty_terminalKirill Chibisov
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.
2023-10-11Use openpty-rustix instead of nixKirill Chibisov
Follow upstream libraries and use rustix to reduce the amount of dependencies in the future. Co-authored-by: Christian Duerr <contact@christianduerr.com>
2023-10-08Fix PTY being closed on creationKirill Chibisov
The PTY got closed because `OwnedFd` automatically closed it. Fixes: 59c63d37 (Update dependencies)
2023-10-08Update dependenciesChristian Duerr
This patch applies all breaking and non-breaking dependency updates and bumps MSRV to 1.70.0.
2023-10-07Port from mio to pollingJohn Nunley
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.
2023-07-13Unset `XDG_ACTIVATION_TOKEN` in alacritty_terminalKirill Chibisov
This variable is what being used for Wayland's activation stuff.
2023-06-19Add support for loading conpty.dllPavel Roskin
Co-Authored-By: @fredizzimo Co-Authored-By: @grueslayer
2023-06-11Bump dependenciesPavel Roskin
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2023-05-17Update xdg and dirs crateKirill Chibisov
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.
2023-02-02Prefer environment variables over passwdJovan Gerodetti
2022-10-22Fix startup failure on macOS with dash as /bin/shKirill Chibisov
The dash's exec doesn't have `-a` argument we rely on when running login shell, so use zsh instead. Fixes #6426.
2022-09-30Migrate from winapi to windows-syskillian
2022-09-01Add IPC config subcommandChristian Duerr
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.
2022-07-24Register Alacritty shells as tty sessions on macOSChris Copeland
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.
2022-07-20Remove panics from UNIX PTY initializationMikayla Maki
Co-authored-by: Mikayla Maki <mikayla.c.maki@icloud.com>
2022-07-20Replace `map().unwrap_or()` with `map_or()`Chris Copeland
Use a `map_or` instead of a `map().unwrap_or()` chain.
2022-06-02Fix a few minor clippy lintsYuri Astrakhan
2022-04-06Extract `SizeInfo` from alacritty_terminalKirill Chibisov
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.
2021-12-19Remove shared PID/FD variablesChristian Duerr
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.
2021-11-22Add parameters to `msg create-window` subcommandKirill Chibisov
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.
2021-11-15Update signal-hook to 0.3.10James McCoy
2021-10-23Add multi-window supportChristian Duerr
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.
2021-10-11Update rustfmt configurationChristian Duerr
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.
2021-09-15Remove unused struct fieldsChristian Duerr
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)]`.
2021-03-30Unify the grid line indexing typesChristian Duerr
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.
2021-01-01Remove Windows WinPTY backendChristian Duerr
2020-12-22Remove terminfo dependencyCaden Haustein
Fixes #4597. Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-09-27Add support for single line terminalsii41
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>
2020-08-31Disable WinPTY with windows-gnu toolchainMateusz Mikuła
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2020-08-06Use `tcgetpgrp` to get PID for SpawnNewInstanceChristian Duerr
Fixes #4082.
2020-07-28Bump minimum supported Rust version to 1.43.0Kirill Chibisov
2020-07-14Fallback to SHELL instead of passwd if presentMattbazooka
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>
2020-07-11Remove gui dependencies from alacritty_terminalKirill Chibisov
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.
2020-06-06Remove copyright notice from filesChristian Duerr
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.
2020-06-05Refactor Shell, Command, and Launcher to share implKirill Chibisov