summaryrefslogtreecommitdiff
path: root/alacritty_terminal/tests
AgeCommit message (Collapse)Author
2024-02-14Fix regional scrolling leaking into historyChristian Duerr
This fixes an issue where a scrolling region that does not start at the top of the screen would still rotate lines into history when scrolling the content "upwards".
2024-01-06Fix serde tests without default featuresChristian Duerr
Authored-by: James McCoy <jamessan@jamessan.com>
2023-11-11Add `--option` argument to `create-window`Christian Duerr
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.
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-05-23Switch to VTE's built-in ansi featureAnhad Singh
Co-authored-by: Christian Duerr <contact@christianduerr.com>
2023-05-17Update bitflags to 2.2.1Kirill Chibisov
2023-03-19Fix `;` character in URI OSC 8 payloadKirill Chibisov
The special character `;` can be not URL-encoded, thus it'll add extra parameter in the payload. Handle it joining extra parameters with the `;` as a separator.
2023-02-02Update winit to 0.28Kirill Chibisov
Fixes #6644. Fixes #6615. Fixes #6558. Fixes #6515. Fixes #3187. Fixes #62.
2023-01-15Preserve last column with erase in line rightChristian Duerr
When the erase in line escape sequence with a parameter of 0 (right) is passed while the wrapline flag is already set, it will no longer clear the last column and instead ignore the operation. The behavior of `\e[1K` and `\e[2K` is unchanged and both will clear the entire first line without clearing the wrapline flag. Closes #6159.
2022-07-24Fix inverted condition for cell's extra clearingKirill Chibisov
Fixes #6215.
2022-07-10Add support for hyperlink escape sequenceKirill Chibisov
This commit adds support for hyperlink escape sequence `OSC 8 ; params ; URI ST`. The configuration option responsible for those is `hints.enabled.hyperlinks`. Fixes #922.
2022-06-01Fix DEC Special Character Set (Line drawing)André Kugland
This patch resolves some mapping issues with the line drawing character set where characters like linefeed were incorrectly mapped to their proper character representation rather than the codepoint of their identification glpyh. Co-authored-by: Christian Duerr <contact@christianduerr.com>
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.
2022-03-16Add colored underline supportKirill Chibisov
This commit adds support for colored underline and refines the dynamic extra storage. The extra storage now is using `Arc` making cloning it way faster compared to `Box` approach which scales really well when it comes to cloning in `Term::write_at_cursor`, since cloning `Arc` is constant time. Fixes #4142.
2022-02-08Add support for drawing undercurlsKirill Chibisov
Fixes #1628.
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-04-17Fix out of order terminal query responsesChristian Duerr
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.
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-24Move renderable cell transformation to alacrittyChristian Duerr
This refactors a large chunk of the alacritty_terminal API to expose all data necessary for rendering uniformly through the `renderable_content` call. This also no longer transforms the cells for rendering by a GUI but instead just reports the content from a terminal emulation perspective. The transformation into renderable cells is now done inside the alacritty crate. Since the terminal itself only ever needs to know about modified color RGB values, the configuration for colors was moved to the alacritty UI code.
2020-11-05Use dynamic storage for zerowidth charactersChristian Duerr
The zerowidth characters were conventionally stored in a [char; 5]. This creates problems both by limiting the maximum number of zerowidth characters and by increasing the cell size beyond what is necessary even when no zerowidth characters are used. Instead of storing zerowidth characters as a slice, a new CellExtra struct is introduced which can store arbitrary optional cell data that is rarely required. Since this is stored behind an optional pointer (Option<Box<CellExtra>>), the initialization and dropping in the case of no extra data are extremely cheap and the size penalty to cells without this extra data is limited to 8 instead of 20 bytes. The most noticible difference with this PR should be a reduction in memory size of up to at least 30% (1.06G -> 733M, 100k scrollback, 72 lines, 280 columns). Since the zerowidth characters are now stored dynamically, the limit of 5 per cell is also no longer present.
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-28Add escape to report text area sizeAyose Cazorla
This implements the escapes `CSI 14 t` and `CSI 18 t` which report the text area size in pixels and characters.
2020-08-12Add support for double underlinesChristian Duerr
This adds support for double underlines using the colon separated escape sequence `CSI 4 : 2 m`. Alacritty will now also always fallback to the normal underline in case any of the other underlines like the undercurl are specified. The escape sequence `CSI 4 : 0 m` can now be used to clear all underlines. Some terminals support `CSI 21 m` for double underline, but since Alacritty already uses that as cancel bold which is a little more consistent, that behavior has not changed. So the colon separated variant must be used.
2020-08-07Add support for colon separated SGR parametersChristian Duerr
This implements the colon separated form of SGR 38 and 48. Fixes #1485.
2020-07-09Add regex scrollback buffer searchChristian Duerr
This adds a new regex search which allows searching the entire scrollback and jumping between matches using the vi mode. All visible matches should be highlighted unless their lines are excessively long. This should help with performance since highlighting is done during render time. Fixes #1017.
2020-07-06Fix saved cursor handlingChristian Duerr
This resolves several problems with handling of the saved cursor when switching between primary and alternate screen. Additionally ref-tests are also added for all common interactions to make sure the behavior does not regress. The behavior is based on XTerm's behavior except for interaction with `reset`. XTerm does not reset the alternate screen's saved cursor on `reset`, but VTE does. Since a `reset` should reset as much as possible, Alacritty copies VTE here instead of XTerm.
2020-07-06Preserve linewrap flag across alt screen switchesChristian Duerr
While neither VTE, URxvt nor Kitty handle this, preserving the linewrap flag across alternate screen switches seems like the correct thing to do. XTerm also does handle this correctly, which indicates that it is a bug and not a feature.
2020-06-25Fix scroll down escape pulling lines from historyChristian Duerr
This works around a bug where the optimized version of the `Grid::scroll_down` function would just rotate the entire grid down if the scrolling region starts at the top of the screen, even if there is history available. Since rotations of scrolling regions should not affect the scrollback history, this optimized version is now only called when the max scrollback size is 0, making it impossible for the grid to have any history while it is used. Since the main usecase of this is the alternate screen buffer, which never has any history, the performance should not be affected negatively by this change. Fixes #3582.
2020-06-07Remove copypasta dependency from alacritty_terminalKirill Chibisov
2020-05-30Refactor Term/Grid separationChristian Duerr
This commit aims to clear up the separation between Term and Grid to make way for implementing search. The `cursor` and `cursor_save` have been moved to the grid, since they're always bound to their specific grid and this makes updating easier. Since the selection is independent of the active grid, it has been moved to the `Term`.
2020-05-05Extend style guideline documentationChristian Duerr
2020-03-26Remove `fs::read_to_string` reimplementationsChristian Duerr
After two previous PRs already removed some instances of reimplementations of the `fs::read_to_string` functionality, this removes the last remaining occurence and with it all instances of `File::open`. So this should remove them all for good.
2020-03-25Remove std::fs::read_to_string reimplementation from testsMatthias Krüger
2020-01-26Fix incorrect grid.len() and grid.history_size()Kirill Chibisov
2020-01-04Update outdated reftestsKirill Chibisov
2019-12-24Fix screen reset not clearing cell flagsChristian Duerr
2019-12-10Fix colored row reset performanceChristian Duerr
This fixes a bug where a row would always get reset completely if its background does not equal the default terminal background. This leads to big performance bottlenecks when running commands like `echo "\e[41m" && yes`. Instead of resetting the entire row whenever the template cell is not empty, the template cell is now compared to the last cell in the row. The last cell will always be equal to the previous template cell when `row.occ < row.inner.len()` and if `occ` is equal to the row's length, the entire row is always reset anyways. Fixes #2989.
2019-11-17Fix cell reset not clearing flags and foregroundKirill Chibisov
Fixes #2330.
2019-11-15Add reftest for line deletionChristian Duerr
2019-11-10Add ref test for verifying colored clear behaviorChristian Duerr
This covers the behavior of clearing the screen and a row with colored cells. This covers a bug discovered in #2329 which was not detected in any existing ref tests.
2019-11-04Fix incorrect cell foreground when clearing screenChristian Duerr
This fixes a bug that would clear the cells with the current template cell with just the `flags` reset, to make sure the colors are correct. However, the cell foreground was not reset, leading to cells counting as occupied when resizing. With this change both cell flags and foreground color are ignored when clearing both the whole screen and inside the line, allowing us to accurately keep track of cell occupation. Fixes #2866.
2019-10-05Update to winit/glutin EventLoop 2.0Christian Duerr
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.
2019-08-06Ignore unsupported CSI sequencesKoichi Murase
Instead of ignoring unexpected intermediates in CSI escape sequences, the intermediates are now explicitly checked and the escape sequence is rejected when an unexpected intermediate is found. Fixes #2171.
2019-08-01Remove color from log outputChristian Duerr
Fixes #2474.
2019-07-10Fix row occ not set during new and resetChristian Duerr
Since ref tests were only stored whenever winit requested the window close, they would not get stored properly when the terminal was closed through Alacritty using `exit`, Ctrl+D or similar. This moves the ref test code to the and of the main entry point, which will always be executed regardless of how the terminal was shutdown. Fixes #2613.
2019-05-10Refactor config parsing filesChristian Duerr
This is a large refactor of the config parsing structure, attempting to reduce the size of the file a bit by splitting it up into different modules with more specific purposes. This also fixes #2279.
2019-04-28Switch from copypasta to rust-clipboardChristian Duerr
This switches our own `copypasta` crate with the more standardized `clipboard` library, which allows us to get rid of the `xclip` dependency on X11. Additionally, this lays the foundation for native Wayland clipboard support once the clipboard crate is updated (or a fork is created). Fixes #5.
2019-04-28Split alacritty into a separate cratesTheodore Dubois
The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.