aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src
Commit message (Collapse)AuthorAge
* Add configurable crosshairs to Alacritty.Josh Rahm2021-10-08
| | | | | | This allows the user to put semitransparent rectangles around the current cursor line and column, á la Vim's cursor line/column, but for the whole terminal.
* Merge remote-tracking branch 'betaboon/graphics' into experimentalJosh Rahm2021-10-05
|\
| * fixupbetaboon2021-08-17
| |
| * Define MAX_GRAPHIC_DIMENSIONS as a 2-elements array.Ayose2021-08-17
| |
| * Avoid unnecessary clone when set graphic data.Ayose2021-08-17
| |
| * remove an unncessary variable from insert_graphicDaniel Brooks2021-08-17
| |
| * Don’t erase text behind a sixel image; the image might be transparentDaniel Brooks2021-08-17
| | | | | | | | | | | | We still add a reference to the graphic in the first cell of every line under the image, but we don’t erase any of the text in any of the cells.
| * Don't clear cells after the right side of the graphic.Ayose2021-08-17
| |
| * Implementation of the XTSMGRAPHICS sequence.Ayose2021-08-17
| |
| * Add Sixel supportAyose2021-08-17
| | | | | | | | Fixes #910
* | Added a dotted underline feature and changed the undercurl feature to beJosh Rahm2021-09-27
| | | | | | | | more antialiased.
* | Add overline attribute.Josh Rahm2021-09-15
| |
* | Added ability to set the special color for the undercur and underlines using ↵Josh Rahm2021-09-15
| | | | | | | | the standard ANSI code 59
* | Added a rudimentary undercurl to Alacritty. Currently does not support ↵Josh Rahm2021-09-15
|/ | | | setting the color. That is the next task
* Fix fullwidth character crash on resizeChristian Duerr2021-08-01
| | | Fixes #5383.
* Fix insert mode crash with fullwidth charactersChristian Duerr2021-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch resolves an issue with fullwidth characters, where it is possible to crash Alacritty by moving a fullwidth character off the side of the terminal using insert mode. This issue occurs since trying to overwrite a fullwidth spacer in the first column leads to an underflow when trying to access its fullwidth character cell. During insert mode before the character is inserted into the cell, the existing content is rotated to the right, which leads to the fullwidth spacer being in the first column even though it is only there temporarily to be immediately overwritten. While it would be possible to clear the flags after rotation, this would still leave the opportunity for other ways to trigger this issue and cause a separate crash. So instead the column is checked while overwriting the spacer to make sure the fullwidth character isn't accessed if it would lead to an underflow. The following is a minimal example for reproducing this crash: ```sh printf "漢" printf "\e[4h" printf "\r" for _ in $(seq 3 $(tput cols)); do printf "x" done printf "\r_" ``` Fixes #5337.
* Fix vi cursor tracking during scrollingChristian Duerr2021-07-17
| | | | | | | | | | | | This resolves an issue with the vi mode cursor where it would not keep track of the content while scrolled up in history but instead slowly leave the viewport due to its absolute positioning. While an alternative solution would have been to always keep the vi mode cursor in the same spot on the viewport, keeping track of the content is not only more easy to implement but it also makes for a nicer connection between the vi mode cursor and the content below it. Fixes #5339.
* Fix copying interrupted tab charactersChristian Duerr2021-07-16
| | | Fixes #5084.
* Fix search regressionsChristian Duerr2021-07-12
| | | Fixes #5315.
* 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.
* Fix vi cursor motion with ScrollPage* actionsa5ob7r2021-07-04
| | | | | | | | | This fixes the regression that vi cursor doesn't move to appropriate position to emulate vi/vim after invokes `ScrollPage*`. To emulate vi/vim the cursor should move up/down some lines if the viewport on topmost scrollback buffer or on bottommost one when invokes `ScrollPage*` action. Otherwise the cursor should look like no movement relatively on viewport.
* Fix crash when resizing during vi modeChristian Duerr2021-07-04
| | | | | | Our resize clamping logic for the vi mode cursor did not correctly clamp to the viewport after the indexing change. Now it is enforced that the vi mode cursor cannot leave the visible area after a font or viewport size change.
* 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 clippy warningsChristian Duerr2021-07-03
|
* Fix regex search regressiona5ob7r2021-06-20
|
* Fix ScrollHalfPageUp vi cursor motion regressiona5ob7r2021-06-16
| | | | | This regression was introduced in 3bd5ac2. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Fix crashes with cut-off fullwidth charactersChristian Duerr2021-05-28
| | | | | | | | | | | | | There's a few places in Alacritty where it was assumed that after a WIDE_CHAR cell, there'd always be a WIDE_CHAR_SPACER. However since resizes in the alternate screen buffer do not reflow any content, it's possible to have a WIDE_CHAR without any WIDE_CHAR_SPACER right behind it. This patch changes these instances to be more defensive about accepting potentially unreasonable input data caused by alt screen resizes. Fixes #5185. Fixes #5170.
* Improve rendering performanceChristian Duerr2021-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | This PR combines a couple of optimizations to drastically reduce the time it takes to gather everything necessary for rendering Alacritty's terminal grid. To help with the iteration over the grid, the `DisplayIter` which made heavy use of dynamic dispatch has been replaced with a simple addition to the `GridIterator` which also had the benefit of making the code a little easier to understand. The hints/search check for each cell was always performing an array lookup before figuring out that the cell is not part of a hint or search. Since the general case is that the cell is neither part of hints or search, they've been wrapped in an `Option` to make verifying their activity a simple `is_some()` check. For some reason the compiler was also struggling with the `cursor` method of the `RenderableContent`. Since the iterator is explicitly drained, the performance took a hit of multiple milliseconds for a single branch. Our implementation does never reach the case where draining the iterator would be necessary, so this sanity check has just been replaced with a `debug_assert`. Overall this has managed to reduce the time it takes to collect all renderable content from ~7-8ms in my large grid test to just ~3-4ms.
* Fix crash when copying out of bounds selectionsChristian Duerr2021-05-07
| | | Fixes #5067.
* Fix release mode testsChristian Duerr2021-05-01
| | | Fixes #5041.
* Fix single column block selectionChristian Duerr2021-05-01
| | | Fixes #5039.
* Fix replacement of fullwidth charactersChristian Duerr2021-04-29
| | | Fixes #3726.
* Fix cursor expansion across wide charsChristian Duerr2021-04-22
| | | | | | | | | This fixes a regression introduced in 0.7.0 where the block cursor would not expand across both cells anymore when on top of a wide char spacer cell. The logic to always move the cursor on the wide char instead of the spacer has been moved to the alacritty_terminal crate, making sure it is always performed before any processing in the UI.
* 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.
* Fix initial vi cursor position while in scrollbackChristian Duerr2021-04-14
| | | Fixes #4968.
* Add vi/mouse hint highlighting supportChristian Duerr2021-04-13
| | | | | This patch removes the old url highlighting code and replaces it with a new implementation making use of hints as sources for finding matches in the terminal.
* Fix automatic scrolling on resizeRichard Steinmetz2021-04-08
|
* 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`.
* Keep viewport in place during resizeRichard Steinmetz2021-03-31
| | | | | Fixes #4879. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* 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.
* Add regex terminal hintsChristian Duerr2021-03-01
| | | | | | | | | | | | | | | | This adds support for hints, which allow opening parts of the visual buffer with external programs if they match a certain regex. This is done using a visual overlay triggered on a specified key binding, which then instructs the user which keys they need to press to pass the text to the application. In the future it should be possible to supply some built-in actions for Copy/Pasting the action and using this to launch text when clicking on it with the mouse. But the current implementation should already be useful as-is. Fixes #2792. Fixes #2536.
* 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.
* Match intermediates directly in CSI parserChristian Duerr2021-02-24
| | | | | | | | There's no point in always trying to access the first field of the intermediates when the only goal is figuring out that there is none. Matching on all intermediates should make it possible to easily match multiple intermediates directly using array matchers.
* Fix search freezing AlacrittyChristian Duerr2021-02-18
| | | | | | | This resolves a regression introduced in 530de00 where searching would cause a deadlock when the viewport is at the bottom of the scrollback and a match ends in the last cell. Fixes #4800.
* Fix cursor position when scrolled into historyChristian Duerr2021-02-18
| | | | | | | This fixes a regression introduced in 530de00, where the terminal cursor would move up when the user scrolled up in the terminal history, rather than staying in place. Fixes #4784.
* Update dependenciesChristian Duerr2021-02-13
| | | | | | This introduces some duplicate dependencies, though they are necessary to build properly without any warnings. Fixes #4735.
* Move renderable cell transformation to alacrittyChristian Duerr2021-01-24
| | | | | | | | | | | | 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.
* Remove all rustc benchmarksJames McCoy2021-01-21
| | | Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Fix assertion crash on 32-bit systemsr-c-f2021-01-11
| | | Fixes #4687.
* Fix inefficient search initializationChristian Duerr2021-01-07
| | | | | | The creation of the renderable search iterator was doing a lot of work even when absolutely no search is active at the moment. To resolve this problem, an early return now makes sure that a search is active before going through the trouble of creating an iterator for it.