aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-02-20Add strikeout metrics for macosunderline-strikethroughChristian Dürr
Macos doesn't provide their own strikeout metrics, so instead of using the font metrics a fallback is used. Since this seems to be stored separately on freetype too, there might be a different way to get strikeout position and thickness (without CoreText)
2018-02-18Add bounds check to underlineChristian Duerr
To make sure the underline never goes beyond the cell bounds, a check has been added. Whenever an underline would normally be below the bottom line of the cell, it is now placed `underline_thickness` above the bottom line. So the position metric is ignored and the underline is rendered with the correct thickness but right at the bottom of the cell.
2018-02-16Add proper strikeout positioningChristian Duerr
With this change the strikeout should make proper use of the metrics in the OS2 table. These metrics are available for all TTF and OTF fonts. If the metrics are not supplied, a fallback strikeout based on underline thickness and cell height is used. To go in line with the metrics supplied by the OS2 table, the term of `strikethrough` has been replaced with `strikeout` everywhere. I think it makes sense to go forward with using `strikeout` in general when talking about this. There has also been a small bug where the cell would not be underlined/striked out when an underline is broken over multiple lines. This has been fixed and the underline/strikeout should always be applied to each cell with this flag.
2018-02-16Apply scaling to underlineChristian Duerr
Until now the underline position and thickness has been used without applying any scaling. However they are both specified in font units which do not change with the font size. To make sure the underline looks correct with every size of the font, the thickness and position are now scaled by the `x_scale` stored in the font metrics. This does not fix strikethrough yet, even though it looks significantly better, the implementation is still a hack. To make sure the underline doesn't disappear with small fonts, the minimum underline thickness has been set to `1`. This decision was made because the `Hack` font has an underline thickness under `0.5` with relatively big fonts. This edge-case can lead to some odd behavior when making the font size super tiny (smaller than readable) so just not rendering any underline might be a viable alternative.
2018-02-16Rework line positionChristian Duerr
Line position has been reworked to be more accurate to freetype specification. However, the strikethrough position is not documented in freetype so a weird hack has been chosen for now, further improving this depends on getting an accurate underline first. Underlines seem messed up because freetype is reporting a fixed underline position no matter how big the font size. This can lead to the underline leaving the glyph box with small fonts and a proportionally tiny underline with big fonts.
2018-02-16Remove unused variableChristian Duerr
2018-02-16Render underline/strikethrough as rectsChristian Duerr
Support for strikethrough has been added by inserting and removing a `STRIKE_THROUGH` flag on the cell. Now all strikethrough and underline drawing is also done through the rectangle renderer. So no glyphs are used to render underlines and strikethrough. The position is taken from the font metrics and should be accurate for linux, however is not yet tested on macos. It works by checking the underline state for each cell and then drawing from the start until the last position whenever an underline ended. This adds a few checks even if no underline is rendered but I was not able to measure any significant performance impact. Fixes jwilm/alacritty#806. Fixes jwilm/alacritty#31.
2018-02-16Switch viewport before rendering rectanglesChristian Duerr
To make sure it is possible to draw over the complete window, the viewport is removed before rendering rectangles now. This makes the visual bell behave properly and flash over the padding of the terminal too, instead of just flashing the grid. However when rendering a rectangle now, the padding has to be taken into consideration.
2018-02-16Add separate rectangle drawing methodChristian Duerr
In preparation for potential other users of the rectangle drawing, a new method has been added which moves all the setup and teardown outside of the render_rect method. This change will hopefully make it more efficient to draw loads of rectangles in one frame and prevent excessive program swaps.
2018-02-16Remove `ShaderProgram::(de)activate` abstractionChristian Duerr
The abstraction for activating and deactivating shaders has been removed because the single-line abstraction did not add much with a second shader program added. Because RectShaderProgram was added too, it required maintaining four different methods for activating and deactivating shaders.
2018-02-16Refactor documentation and variable namesChristian Duerr
2018-02-16Swap programs instead of shadersChristian Duerr
Instead of swapping shaders, now there are two programs kept around that are swapped out when needed. This has the benefit of skipping the expensive linking process that is required after swapping the shaders on a program.
2018-02-16Fix clippy issuesChristian Duerr
2018-02-16Draw visual bell as big quad over everythingChristian Duerr
A method `render_rect` has been added that allows drawing a rectangle over anything in the terminal. This is used by the visual bell to draw a big rectangle over everything. To achieve this a new shader has been added. Shaders are now kept around until the program is dropped. Then whenever a rectangle draw call is issued, the shader is swapped from the default shader to the rectangle drawing shader. After the shader has been swapped and the rectangle has been drawn, uniforms (like projection) and blending function are reset to make sure the rendering can be continued on the default shader. All current instances of visual_bell in the rendering have been removed, it is now all done exclusively through the rectangle rendering function. Currently the shaders are swapped every time `render_rect` is called, so when rendering multiple rectangles (potentially for underline / strikethrough) there would be a loads of shader swaps that could be potentially very expensive. So before using `render_rect` for a different application, the shader swap should be removed from the `render_rect` method. As long as the visual bell's alpha value is 0, this has no effect on performance because no rectangle is rendered.
2018-02-16Add clippy check to travisChristian Duerr
This commit adds clippy as a required step of the build process. To make this possible, all existing clippy issues have been resolved.
2018-02-16Improve ability of alacritty to deal with broken configChristian Duerr
Until now alacritty completely refuses to start when the config is broken in any way. This behavior has been changed so the worst-case is always that alacritty launches with the default configuration. When part of the config is broken, alacritty shouldn't instantly try to recover to the default config, but instead try to use defaults only for the parts of the config which are broken. This has also been implemented for most of the fields in the configuration. So it should be possible that parts are broken, but the rest is still used for the configuration. This fixes #954.
2018-02-16Make visual bell flash color customizableChristian Dürr
This addresses the main feedback in jwilm/alacritty/pull/430. I've decided to go from scratch instead of basing my work on top of what markandrus has already implemented to keep it as simple as possible. If there's any stuff that I should take from the other PR, please let me know. I can also try to send a PR to markandrus.
2018-02-13Add install instructions via cargo --gitOliver Jan Krylow
2018-02-13Add info about default configuration for macOSSaugat Acharya
2018-02-11`starting` not `staring` (#1074)Steven Noble
2018-02-07fix fallbacks in macos (#1099)Joe Moon
fixes #1086
2018-01-31Update core-text (#1061)Jeff Muizelaar
This cleans up a bunch of code.
2018-01-30Update lockfileChristian Duerr
Updated the lockfile to make sure clippy is building properly with the latest nightly toolchain.
2018-01-26Update dependenciesgolem131
Updated the version of some dependencies. This also changes to a new clippy version so clippy can work with the latest nightly compiler again. Some issues created by new lints have been fixed.
2018-01-21Better character cell width with FreeType (#1029)Rachel K
This should fix #1020, #710, and #902
2018-01-18Implement `reset_state` of Term struct (#1035)Christian Duerr
Up to this point the `reset_state` method of the `Term` struct has been just a placeholder. This has been changed and all important state has been reset. The only state that has not been reset is stuff which is retrieved from the config and isn't stored as default on the `Term` struct either. From what I can tell these are all never changed though. This fixes jwilm/alacritty#1033. After doing some more testing trying to figure out how to fix that all glyphs are messed up after doing `cat /dev/urandom`, I was able to confirm that resetting `Term::cursor` fixes the glyphs and restores everything to normal. So this also fixes jwilm/alacritty#804.
2018-01-16Update lockfile (#1031)Christian Duerr
The lockfile has been updated to make clippy work with nightly again.
2018-01-15Spawn alacritty window as invisibleChristian Duerr
This change initially spawns alacritty as in invisible window, this makes it possible for the pty to already access data like `window_id` without having to wait for the window manager to actually open the window. Even though `GlWindow::new` is blocking when `with_visibility(true)` is used, the `window.show` call is not blocking. So calling `GlWindow::new` and `with_visibility(false)`, then immediately calling `window.show` will create a window and make it visible instantly.
2018-01-11Update lockfileChristian Duerr
Clippy failed to build with the latest nightly, so the lockfile has been updated to allow the nightly builds to work again.
2018-01-10Expand key binding config documentationChristian Duerr
A link to all variants available as `key` has been added to the key bindings documentation, to help users with finding the right place for mapping key codes.
2018-01-10Make Mac app installation steps idempotent (#1015)Paul Alvarez
Repeated uses of `cp -r target/release/osx/Alacritty.app /Applications/Alacritty.app` will result in copying Alacritty.app to `/Applications/Alacritty.app/Alacritty.app`.
2018-01-08Fix `ioctl` call failing on 32 bit architecture (#1011)Christian Duerr
2018-01-08Fix indexed color setting regressionNiklas Claesson
Commit 2920cbe7103f03a45080bfb7610bd7f481f36361 introduced a regression because of a typo in the chunk slice index for the `parse_rgb_color` call. This fixes this issue by resetting it to the state it was before the faulty commit.
2018-01-07Revert #987 behavior on macos (#1007)Christian Duerr
2018-01-07Non-bracketed paste support for DOS CRLFs.Giorgio Gallo
When pasting in non-bracketed more, all line endings (including DOS-style CRLFs) get normalized to a single CR to simulate a keypress of the <return> key.
2018-01-07Resolves #733.Giorgio Gallo
When pasting in non-bracketed mode, LFs are replaced with CRs.
2018-01-06Honour working dir on linux (#987)Christian Duerr
2018-01-06Fix SGR mouse reportingJoe Wilm
There were two bugs fixed in this commit: 1. `sgr_mouse_report` was not always called when `SGR_MOUSE` bit was set due to calling `normal_mouse_report` instead of `mouse_report` in the scrolling method. 2. SGR reporting was always going off the left mouse button state rather than what was appropriate. This affected SGR scroll reporting since it only behaves correctly for pressed events (final character 'M'). Resolves #698.
2018-01-06Add clippy check to travisChristian Duerr
This commit adds clippy as a required step of the build process. To make this possible, all existing clippy issues have been resolved.
2018-01-06Improve ability of alacritty to deal with broken configChristian Duerr
Until now alacritty completely refuses to start when the config is broken in any way. This behavior has been changed so the worst-case is always that alacritty launches with the default configuration. When part of the config is broken, alacritty shouldn't instantly try to recover to the default config, but instead try to use defaults only for the parts of the config which are broken. This has also been implemented for most of the fields in the configuration. So it should be possible that parts are broken, but the rest is still used for the configuration. This fixes #954.
2018-01-05Prevent font_size_modifier from sinking too low (#994)Christian Duerr
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.
2018-01-03Pass ModifiersState to mouse_moved method tooChristian Duerr
2018-01-03Pass ModifiersState to mouse input as wholeChristian Duerr
ModifiersState is now passed to the mouse methods in `input.rs` as a whole instead of just passing the `shift` state. This should make it a bit easier to do changes in the future.
2018-01-03Always clear selectionChristian Duerr
It seems like the common consensus is that even in mouse mode, the selection should be cleared with a normal click. If there is any reason why this should not be the case, please let me know.
2018-01-03Use default modifier stateChristian Duerr
The tests were using a manually setup `ModifiersState`, to clean things up a bit the `ModifiersState::default` method has been used to replace this.
2018-01-03Fix failed testsChristian Duerr
Three was still a test which passed the whole modifiers struct instead of just the shift bool, this has been fixed.
2018-01-03Update mouse modifiers to only pass shiftChristian Duerr
The only mouse modifier required right now is the shift key, to prevent passing around unnecessary state, only the shift state is passed to the mouse processors now.
2018-01-03Enable shift+select in mouse modeChristian Dürr
When an application takes control over the mouse, it usually disables selection completely. However the common way to still make selection possible is by allowing selection while the shift key is held down. This feature is implemented here by making use of the new `modifiers` field on mouse events with glutin/winit. This fixes jwilm/alacritty#146.
2018-01-02Add support for set-clipboard. (#970)Geert Jansen
This allows e.g. tmux to set the clipboard via the OSC 52 escape code.
2018-01-02Address feedbackChristian Duerr
The config documentation has been changed to make it clear which part of the documentation is related to which setting. The faux scrollback part of the `scroll_terminal` method has been cleaned up by making use of the fact that the `codepoint + 1` can be used in the escape sequence which is used for scrolling.