aboutsummaryrefslogtreecommitdiff
path: root/src/display.rs
Commit message (Collapse)AuthorAge
* Split alacritty into a separate cratesTheodore Dubois2019-04-28
| | | | | The crate containing the entry point is called alacritty, and the crate containing everything else is called alacritty_terminal.
* Fix message bar not updating PTY sizeChristian Duerr2019-04-24
|
* Add fullscreen supportacheronfail2019-04-23
| | | | Fixes #34. Fixes #2012.
* Fix cursor dimensions with font offsetChristian Duerr2019-04-19
| | | | | | | | | | | | | | Previously cursor dimensions were not calculated correctly when a font offset was specified, since the font offset was completely ignored. This has been fixed by moving all the cursor logic from the font into the Alacritty crate, applying the config's offsets before rasterizing the cursors. This has also fixed an issue with some cursors not being rendered as double-width correctly when over double-width glyphs. This fixes #2209.
* Update pty size when font size changedNicolas Hahn2019-04-19
|
* Fix update_lines performance issuesChristian Duerr2019-04-19
| | | | | | | | | | | This resolves performance issues with the `update_lines` method that were caused by excessive updates without underlines or strikeout present. This also resolves a bug that was causing the underline and strikeout to extend beyond the end of line in some rare cases. This fixes #114.
* Call TIOCSWINSZ only on grid changeEike Christian Karbe2019-04-17
| | | | | Instead of calling TIOCSWINSZ for every pixel change it will now be called only on changes to the grid size. This should reduce screen refreshes. This fixes #2177.
* Fix duplicate resize eventsChristian Duerr2019-04-14
| | | | | | | | | | | | | | | | If a resize event is identical to the current size, it is no longer propagated but the resize is discarded immediately. To further prevent resizes when not necessary, the list of monitors is enumerated and the DPR of the first display is assumed to be the target DPR. This allows spawning a window with dimensions when the config has columns and lines specified and the window only needs to be resized if the estimated DPR is not correct. Fixes #1825. Fixes #204.
* Add rustfmt style guideChristian Duerr2019-03-30
|
* Add option for window position at startupCole Helbling2019-03-11
|
* Fix font spacing errorChristian Duerr2019-02-11
| | | | Fixes #2098.
* Change font size only when new metrics are validMartin Sucha2019-02-09
| | | | | | This prevents cell_width or cell_height being zero. Fixes #1693
* Dynamically resize terminal for errors/warningsChristian Duerr2019-02-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning and error messages now don't overwrite other terminal content anymore but instead resize the terminal to make sure that text can always be read. Instead of just showing that there is a new error and pointing to the log, errors will now be displayed fully in multiple lines of text, assuming that there is enough space left in the terminal. Explicit mouse click handling has also been added to the message bar, which made it possible to add a simple `close` button in the form of `[X]`. Alacritty's log file location is now stored in the `$ALACRITTY_LOG` environment variable which the shell inherits automatically. Previously there were some issues with the log file only being deleted when certain methods for closing Alacritty were used (like typing `exit`). This has been reworked and now Ctrl+D, exit and signals should all work properly. Before the config is reloaded, all current messages are now dropped. This should help with multiple terminals all getting clogged up at the same time when the config is broken. When one message is removed, all other duplicate messages are automatically removed too.
* Scale IME position by hidpi_factorDesuwa2019-02-05
| | | | | | | | | | | Since the IME was positioned using physical coordinates, the location would be incorrect with monitors using a DPR other than 1.0. This has been resolved by converting the physical position to a logical position using the methods built into winit. Fixes #2056.
* Normalize Log Message StringsNathan Lilienthal2019-01-07
| | | | | | The general style for errors, warnings and info messages is to start with a capitalized letter and end without a period. The main exception is when dealing with nouns that are clearer with special case handling, e.g. "macOS failed to work" or "ioctl is borked".
* Add proper underline and strikeout supportChristian Duerr2018-12-22
| | | | | This makes use of the new rectangle rendering methods used to display the colored visual bell to add proper underline and strikeout support to Alacritty.
* Add color option to visual bellChristian Duerr2018-12-17
| | | | | | | | | This adds the option to specify the color of the visual bell using the `visual_bell.color` configuration setting. This is done by rendering a big quad over the entire screen, which also opens up options to draw other arbitrary rectangles on the screen in the future.
* Upgrade to Rust 2018Joe Wilm2018-12-10
| | | | | This resolves a lot of NLL issues, however full NLL will be necessary to handle a couple of remaining issues.
* Ignore initial size if the window is maximized on startdm1try2018-11-23
|
* Display errors and warningsChristian Duerr2018-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make sure that all error and information reporting to the user is unified, all instances of `print!`, `eprint!`, `println!` and `eprintln!` have been removed and replaced by logging. When `RUST_LOG` is not specified, the default Alacritty logger now also prints to both the stderr and a log file. The log file is only created when a message is written to it and its name is printed to stdout the first time it is used. Whenever a warning or an error has been written to the log file/stderr, a message is now displayed in Alacritty which points to the log file where the full error is documented. The message is cleared whenever the screen is cleared using either the `clear` command or the `Ctrl+L` key binding. To make sure that log files created by root don't prevent normal users from interacting with them, the Alacritty log file is `/tmp/Alacritty-$PID.log`. Since it's still possible that the log file can't be created, the UI error/warning message now informs the user if the message was only written to stderr. The reason why it couldn't be created is then printed to stderr. To make sure the deletion of the log file at runtime doesn't create any issues, the file is re-created if a write is attempted without the file being present. To help with debugging Alacritty issues, a timestamp and the error level are printed in all log messages. All log messages now follow this format: [YYYY-MM-DD HH:MM] [LEVEL] Message Since it's not unusual to spawn a lot of different terminal emulators without restarting, Alacritty can create a ton of different log files. To combat this problem, logfiles are removed by default after Alacritty has been closed. If the user wants to persist the log of a single session, the `--persistent_logging` option can be used. For persisting all log files, the `persistent_logging` option can be set in the configuration file
* Fix blurry fonts without dynamic paddingChristian Duerr2018-11-16
| | | | | | | There were some minor rounding issues in the padding codepath without dynamic padding. These have been fixed, which should resolve issues with blurry fonts on monitors with a fractional DPR. This fixes https://github.com/jwilm/alacritty/issues/1806.
* Add option for dynamic padding (#1780)Christian Duerr2018-11-15
| | | | | | | | | | | This adds the `window.dynamic_padding` option which allows disabling the dynamic spread of additional padding around the grid's content. Based on the feedback I've gotten so far and the fact that most other terminal emulators do not seem to center the content inside themselves, I've changed the default configuration option to disable centering of the grid. This fixes #1778.
* Fix specifying 0 lines/columns in config fileChristian Duerr2018-11-13
| | | | | | | | The logic during the initial spawning of the window was a bit twisted up. This has been resolved and it should all work properly now, even without a resize event at startup. This fixes #1781.
* Fix incorrect padding calculationsChristian Duerr2018-11-12
| | | | | | | | | | | | | | | | | | | | The extra window padding was calculated in the renderer which lead to problems with the paddings calculated in the `src/display.rs` and `src/term/mod.rs`. As a solution, every instance of `config.padding().x/y` has been removed from the renderer (`src/renderer/mod.rs`), instead the padding is always passed through from the `src/display.rs`. The initial calculations during display creation and after resize then are scaled appropriately and then the extra padding is calculated. As a result every other location can just make use of the correctly calculated `size_info.padding_x` and `size_info.padding_y`. The documentation has been changed to clearly state that the padding is scaled by DPI now. This fixes #1773.
* Center the grid inside the windowChristian Duerr2018-11-11
| | | | | | | | | | | | | | | | | | | | | | | | | Currently alacritty always puts the grid at the top-left position of the window. The only distance to the top-left window border is set by the padding in the config. However the grid always has a fixed size, and if a cell doesn't completely fit the screen anymore, the padding at the bottom right window corner can be significantly bigger than the padding at the top left. To fix this whenever there is more space left and there would usually be a bigger padding at the bottom right, the space is now split up and added to the padding. This should always center the grid inside the window and make sure all borders have the same padding from the text area. This screenshot shows how it has been until now: ![Before](https://u.teknik.io/kRJwg.png) Here is how it looks now: ![After](https://u.teknik.io/m4puV.png) This fixes #1065.
* Remove re-export of glutin size typesChristian Duerr2018-11-10
|
* Upgrade Glutin to v0.19.0Matt Keeler2018-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some changes include: • Use the with_hardware_acceleration function on the ContextBuilder to not require the discrete GPU • Remove the LMenu and RMenu virtual key codes (winit 0.16.0 removed these because Windows now generates LAlt and RAlt instead • Replace set_cursor_state with hide_cursor (winit 0.16.0 removed the set_cursor_state function) • Replace GlWindow::hidpi_factor with GlWindow::get_hidpi_factor and change to expecting an f64 • Use the glutin/winit dpi size and position types where possible Glutin's dpi change event has been implemented. All size events now return logical sizes. As a result of that, the logical sizes are translated in the `display::handle_rezize` method so DPI scaling works correctly. When the DPI is changed, the glyph cache is updated to make use of the correct font size again. Moving a window to a different screen which is a different DPI caused a racing condition where the logical size of the event was sent to the `handle_resize` method in `src/display.rs`, however if there was a DPI change event before `handle_resize` is able to process this message, it would incorrectly use the new DPI to scale the resize event. To solve this issue instead of sending the logical size to the `handle_resize` method and then converting it to a physical size in there, the `LogicalSize` of the resize event is transformed into a `PhysicalSize` as soon as it's received. This fixes potential racing conditions since all events are processed in order. The padding has been changed so it's also scaled by DPR. The `scale_with_dpi` config option has been removed. If it's not present a warning will be emitted. The `winit` dependency on Windows has been removed. All interactions with winit in Alacritty are handled through glutin.
* Add support for Windows (#1374)Zac Pullar-Strecker2018-10-16
| | | | | | | | | | | | | | | Initial support for Windows is implemented using the winpty translation layer. Clipboard support for Windows is provided through the `clipboard` crate, and font rasterization is provided by RustType. The tty.rs file has been split into OS-specific files to separate standard pty handling from the winpty implementation. Several binary components are fetched via build script on windows including libclang and winpty. These could be integrated more directly in the future either by building those dependencies as part of the Alacritty build process or by leveraging git lfs to store the artifacts. Fixes #28.
* Drop terminal lock before renderingtrimental2018-09-30
| | | | | | | | The terminal lock is now dropped before rendering by storing all grid cells before clearing the screen. This frees the terminal to do other things since the lock is now free, which lead to a performance benefit with high throughput applications.
* Fix mesa rendering outside window borders on waylandtrimental2018-09-23
| | | | | | | | | | The mesa workaround has lead to some issues with rendering on Wayland. To resolve this problem, the mesa workaround has been restructured in a way which still allows clearing the screen before rendering without killing performance with the mesa driver. The performance is identical to the master brach and there have been no recorded regressions.
* Scrollback cleanupChristian Duerr2018-07-21
| | | | | | There were some unneeded codeblocks and TODO/XXX comments in the code that have been removed. All issues marked with TODO/XXX have either been already resolved or tracking issues exist.
* Move selection into GridJoe Wilm2018-06-02
| | | | | | | | | | | Supporting selections with scrollback has two major components: 1. Grid needs access to Selection so that it may update the scroll position as the terminal text changes. 2. Selection needs to be implemented in terms of buffer offsets -- NOT lines -- and be updated when Storage is rotated. This commit implements the first part.
* Update to glutin 0.16.0Francesca Frangipane2018-05-29
| | | | | | | | | Note that `WM_CLASS` is now set to `"alacritty", "Alacritty"` instead of the previous value of `"Alacritty", "Alacritty"`. This seems to be more standard. This also contains some revised recommendations for installing the `.desktop` file.
* Fix clippy lintsChristian Duerr2018-05-11
|
* Prevent negative cell dimensions (#1181)Christian Duerr2018-03-12
| | | | | | | | | | | | | | | | | | | | Prevent the cell dimensions from going below 1, this bug resulted in allocation of large amounts of memory in the scrollback PR but is also present on master. Currently the approach is to just `panic!`, however an `eprintln!` and `exit` could be an alternative too. I don't think it's realistic to check this at startup and it should have no performance impact since the failing method is only called once at startup. To make it a bit more clear what kind of values are accepted, the datatypes of offsets and paddings have also been changed so that these don't accept floats anymore and padding can never be negative. This should allow us to be a bit more strict with the config to make sure that errors are printed when invalid values are specified (like negative padding). This fixes #1167.
* Remove all instances of unwrap() from configChristian Duerr2018-03-04
| | | | | | | | | | | | | | | | | | Unwrapping inside the config file parsing can lead to some issues that prevent us from falling back to a default configuration file. One instance of that issue was mentioned in #1135. Now all instances of `unwrap()` have been removed and replaced with proper error handling. This will make the config more robust and prevents live reload from silently breaking while alacritty is running. This also fixes a few currently existing clippy issues. Clippy added an additonal lint which complains about `MyStruct { field: field }`. These issues have been fixed, except for some false-positives and issues in external macros which will probably be fixed with future updates (rust-lang-nursery/bitflags#149)
* Add clippy check to travisChristian Duerr2018-01-06
| | | | This commit adds clippy as a required step of the build process. To make this possible, all existing clippy issues have been resolved.
* Prevent font_size_modifier from sinking too low (#994)Christian Duerr2018-01-05
| | | | | | | | | This replaces the `font_size_modifier` stored on the `Term` struct with a `font_size` field. With this change it is not necessary anymore to calculate the new font size from a delta but the current font size is always stored directly on the `Term` struct. As a result of this it is now possible to increase the font size by more than 127 steps at runtime. It also limits the minimum font size to 1, so issues with the `font_size_modifier` dropping far below font size 1 are resolved with this change. This fixes #955.
* Change mouse cursor on terminal mode change (#865)Dustin2017-12-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some terminals have functionality around changing the type of mouse cursor dynamically (arrow and text) based on which mode(s) the VTE is in. For example, gnome-terminal changes the cursor from text (default) to an arrow when opening programs that track mouse events (e.g. vim, emacs, tmux, htop, etc.). The programs all allow using the mouse interactively under some circumstances (like executing `set mouse=a` in vim). The programs that use an interactive mouse set the terminal mode to different values. Though they're not entirely the same terminal mode across programs, an emulator like vte (the library gnome-terminal implements), changes the mouse cursor if the mouse mode is one of the following: - 1000: Mouse Click Tracking - 1001: Mouse Highlight Tracking - 1002: Mouse Cell Motion Tracking - 1003: Mouse All Motion Tracking - 1004: Mouse Focus Tracking See https://github.com/GNOME/vte/blob/6acfa59dfcceef65c1f7e3570db37ab245f049c4/src/vteseq.cc#L708 for more information. This commit adds functionality that changes the winit/glutin `MouseCursor` when a mouse-listening mode of 1000-1004 is set. It behaves similarly to when the window title changes.
* Add custom box cursor for unfocused windowChristian Duerr2017-12-24
|
* Add new window section to configRobert Günzler2017-12-22
| | | | Move/rename borderless into window_config as decorations
* Add 'borderless' optionRobert Günzler2017-12-22
| | | | | | Until winit gives us more capabilities in regard to window decorations this implements a simple switch that renders the window without any title bar or border
* clippy: do and don't pass some things by reference as suggested ↵Matthias Krüger2017-12-03
| | | | (needless_pass_by_value, needless_borrow).
* clippy: remove unneeded return statement (needless_return).Matthias Krüger2017-12-03
|
* Revert "Wait to display window until initialization is complete (#907)"Joe Wilm2017-11-20
| | | | | | | | | | | This reverts commit a931d691a21a851ca4653cbab3542c600b72ff36. Please see https://github.com/jwilm/alacritty/pull/907#issuecomment-345666727 for rationale w/ GIF. > now alacritty starts "in stages". First it paints some small > rectangle, and in a second in "boots" and fills up the available > space.
* Wait to display window until initialization is complete (#907)Charles2017-11-19
|
* Fix typo and whitespaceJoe Wilm2017-11-11
|
* Don't enforce window dimensions if configured with 0 columns or linesBryan Gilbert2017-11-11
|
* fix some typos in commentsMartin Lindhe2017-10-30
|
* Set urgent WM flag on bell on X11 systems (#812)Barret Rennie2017-10-21
| | | | | Sets the urgent WM flag when bell is emitted on X11 systems. Additionally, the flag is cleared on focus because not all WMs clear it automatically.