aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display.rs
Commit message (Collapse)AuthorAge
* 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.
* 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.
* Add vi/search line indicatorChristian Duerr2021-01-01
| | | | | | | | | This adds a new visual indicator which shows the position in history of either the display offset during search, or the vi mode cursor. To make it as unintrusive as possible, the overlay is hidden whenever the vi mode cursor collides with its position. Fixes #3984.
* Draw cursor with rect rendererKirill Chibisov2020-12-28
| | | | | | | | This commit makes cursors being drawn via rects, thus it's always above underlines/strikeouts. Also, since the cursor isn't a glyph anymore, it can't be obscured due to atlas switching while glyphs are rendered. Fixes #4404. Fixes #3471.
* Disable shadows for transparent windows on macOSChristian Duerr2020-12-22
| | | | | | | | | | | | Commit 5725f58 introduced a performance regression on macOS due to excessive calls to the `invalidateShadow` function, however calling this function only on redraw after a resize was performed does not fix the underlying problem. As a solution, window shadows are now disabled completely for all transparent windows. This makes sure there is no performance impact, while still solving the problem with text artifacts on resize. Fixes #4604.
* Fix artifacts on macOS with transparent windowsChristian Duerr2020-12-21
| | | | | | | | | | | Due to the way macOS draws shadows for transparent windows, resizing them will lead to text artifacts remaining present after a window has been resized. The `invalidateShadow` call is used whenever the opacity isn't `1.0` to make sure these shadows are cleared before redrawing, so no artifacts remain when resizing transparent windows. Fixes #889.
* 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.
* Add blinking cursor supportDettorer2020-11-23
| | | | | | | | This adds support for blinking the terminal cursor. This can be controlled either using the configuration file, or using escape sequences. The supported control sequences for changing the blinking state are `CSI Ps SP q` and private mode 12.
* Add ability to select text during searchChristian Duerr2020-11-13
| | | | | | | | | | | | | This removes the restriction of not being able to select text while the search is active, making it a bit less jarring of a UX when the user tries to interact with the terminal during search. Since the selection was used during vi-less search to highlight the focused match, there is now an option for a focused match color, which uses the inverted normal match color by default. This focused match is used for both search modes. Other mouse interactions are now also possible during search, like opening URLs or clicking inside of mouse mode applications.
* Use dynamic storage for zerowidth charactersChristian Duerr2020-11-05
| | | | | | | | | | | | | | | | | | | 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.
* Fix crash with large negative font offsetChristian Duerr2020-10-29
| | | Fixes #4363.
* Check viewport size after initial resizeChristian Duerr2020-10-22
| | | | | Since the 'set_inner_size' call might immediately alter the window size, the query for the window's dimensions should be performed after the resize has been requested.
* Fix incorrect X11 feature checkChristian Duerr2020-10-12
| | | See https://github.com/alacritty/alacritty/commit/721f789b5f98ab5c47e6e817c3c2228636ca0a1a#r43183826.
* Make use of glutin wayland/x11 featuresKirill Chibisov2020-10-12
| | | | This should allow users that are not using Wayland/X11 to reduce the resulted binary size and compilation times.
* Bump glutin to 0.25.0Kirill Chibisov2020-10-07
| | | | | | | | | | | | Fixes #4206. Fixes #4162. Fixes #4017. Fixes #3998. Fixes #3831. Fixes #3782. Fixes #3708. Fixes #2734. Fixes #2714. Fixes #1801.
* 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>
* Fix IME position with fullwidth chars in searchChristian Duerr2020-09-25
|
* Log new padding and cell size on 'SizeInfo' updateKirill Chibisov2020-09-24
| | | | This makes our logging of 'SizeInfo' changes more consistent with the one we're using when creating a new 'Display'.
* Add escape to report text area sizeAyose Cazorla2020-08-28
| | | | This implements the escapes `CSI 14 t` and `CSI 18 t` which report the text area size in pixels and characters.
* Use yellow/red from the config for message bar colorsKirill Chibisov2020-08-13
| | | | | | | | | | | | This commit completes the effort to use config colors for message bar content by picking red/yellow from user's colors.normal.{red,yellow} for error/warning messages instead of fixed colors. It also removes alacritty_terminal::term::color::RED and alacritty_terminal::term::color::YELLOW from the alacritty_terminal API, bumping its version to 0.11.0-dev. Fixes #4116.
* Use user's background color for render timer textKirill Chibisov2020-08-13
| | | | | Using the user's background color in pair with red should provide better contrast.
* Bump minimum supported Rust version to 1.43.0Kirill Chibisov2020-07-28
|
* Rename font crate to crossfontChristian Duerr2020-07-18
|
* Fix crashes during searchChristian Duerr2020-07-17
| | | | | | | | | | | | | | | | This fixes two crashes related to search. The first crash was due to variable shadowing computing the incorrect length of a search as soon as it was started, causing an overflow after attempting a subtraction. Since overflows are only debug mode checks, in release this would lead to an IME positioned far, far beyond the window's boundaries (likely offscreen). The other bug was that the search was always started from the last column in reverse search without vi mode, but after shrinking the terminal width that origin point is no longer a valid part of the grid. As a result it would cause an index out of bounds. The line was already clamped to the grid, but now the same is also done for the column. Fixes #3987.
* Add different search label for backward searchChristian Duerr2020-07-17
|
* 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.
* Add regex scrollback buffer searchChristian Duerr2020-07-09
| | | | | | | | | | 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.
* Add automatic scrolling during selectionChristian Duerr2020-06-18
| | | | | | | | | | | | | This adds a new `Scheduler` which allows for staging events to be processed at a later time. If there is a selection active and the mouse is above or below the window, the viewport will now scroll torwards the direction of the mouse. The amount of lines scrolled depends on the distance of the mouse to the boundaries used for selection scrolling. To make it possible to scroll while in fullscreen, the selection scrolling area includes the padding of the window and is at least 5 pixels high in case there is not enough padding present.
* 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.
* Refactor Term/Grid separationChristian Duerr2020-05-30
| | | | | | | | | | | 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`.
* Fix build warnings on macOS/WindowsKirill Chibisov2020-05-27
|
* Add subpixel anti-aliasing support on macOS 10.14+Casper Rogild Storm2020-05-17
|
* Extend style guideline documentationChristian Duerr2020-05-05
|
* Use frame callbacks instead of vsync on WaylandKirill Chibisov2020-05-03
| | | | | | | | | Instead of blocking on vsync, Alacritty now requests a notification from wayland about when the next frame should be rendered. this helps with input latency, since it gives alacritty more time to process events before a redraw. it also prevents alacritty from drawing unless the compositor tells it to do so. Fixes #2851.
* Call glFinish right after swap_buffers on X11Kirill Chibisov2020-05-01
| | | | | | | | | | On X11 `swap_buffers` does not block for vsync. However the next OpenGl command will block to synchronize (this is `glClear` in Alacritty), which causes a permanent one frame delay. Calling `glFinish` after swapping buffers forces Alacritty to finish the buffer swap before returning control to the event loop. Fixes #3061.
* Add config option to set cursor thicknessKirill Chibisov2020-04-15
| | | Fixes #3526.
* Fix various mouse mode + vi mode interactionsKirill Chibisov2020-04-10
| | | | | | | | | This commit fixes some issues introduced by 1a8cd172e520e493bacc9c6a2ae6f80de086eaa3: 1. Vi cursor not moving properly on double/triple click 2. URL not launching via mouse click in vi mode + mouse mode 3. Ability to select in mouse mode with double/triple click regardless of shift modifier
* Add modal keyboard motion modeChristian Duerr2020-03-18
| | | | | | | | | | | | | | | | | | | This implements a basic mode for navigating inside of Alacritty's history with keyboard bindings. They're bound by default to vi's motion shortcuts but are fully customizable. Since this relies on key bindings only single key bindings are currently supported (so no `ge`, or repetition). Other than navigating the history and moving the viewport, this mode should enable making use of all available selection modes to copy content to the clipboard and launch URLs below the cursor. This also changes the rendering of the block cursor at the side of selections, since previously it could be inverted to be completely invisible. Since that would have caused some troubles with this keyboard selection mode, the block cursor now is no longer inverted when it is at the edges of a selection. Fixes #262.
* Move Alacritty to organizationChristian Duerr2020-01-11
| | | | | | | | This fixes various outdated links pointing to the old jwilm/alacritty repository. Since `copypasta` now has its own github repository at https://github.com/alacritty/copypasta, the sources have been removed from Alacritty.
* Bump glutin to 0.22.0Christian Duerr2020-01-10
| | | Fixes #3165.
* Fix macOS OpenGL context resize orderingChristian Duerr2020-01-04
| | | Fixes #2226.
* Replace deprecated Error methodssterlingjensen2020-01-03
|
* Fix high startup time on wlroots compositorsKirill Chibisov2019-12-31
|
* Move renderer from alacritty_terminal to alacrittyKirill Chibisov2019-11-23
|
* Fix division by zero without any cols or linesBurak Yigit Kaya2019-11-14
| | | | | | | | | The URL check uses a division to wrap column indices across lines, which will cause a runtime error if the size of the terminal is zero columns wide. Since a lot of our logic assumes that we at least have one column and line to work with and our behavior doesn't matter otherwise, this change fixes the terminal dimensions to have space for at least one cell.
* Fix URL highlightingChristian Duerr2019-11-03
| | | | Fixes #2898. Fixes #2479.
* Add live config reload for font family and stylewayne2019-11-03
| | | | Fixes #2737.
* Fix message bar drawing over terminal after resizeKirill Chibisov2019-10-29
| | | | | | This regression was introduced in 729eef0c933831bccfeac6a355bdb410787fbe5f. Fixes #2924.
* Fix visual bell rendering modeKirill Chibisov2019-10-26
| | | Fixes #2911.