aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.rs
AgeCommit message (Collapse)Author
2018-07-15Add config for unfocused window cursor changePatrycja Balik
2018-07-01Fix clippy issuesChristian Duerr
2018-06-08Reduce Increase-/DecreaseFontSize step to 0.5Felippe da Motta Raposo
Until now the Increase-/DecreaseFontSize keybinds hand a step size of 1.0. Since the font size however is multiplied by two to allow more granular font size control, this lead to the bindings skipping one font size (incrementing/decrementing by +-2). To fix this the step size of the Increase-/DecreaseFontSize bindings has been reduced to the minimum step size that exists with the current font configuration (0.5). This should allow users to increment and decrement the font size by a single point instead of two. This also adds a few tests to make sure the methods for increasing/decreasing/resetting font size work properly.
2018-05-11Fix clippy lintsChristian Duerr
2018-03-12Extend SGR and VT200 (normal) mouse supportCelti Burroughs
With this commit, Alacritty now reports presses and releases of all three mouse buttons properly, dragging events with all three buttons, and mouse movement events where no button is pressed. It does not report more than three buttons due to inherent limitations of the VT200 and SGR protocol modes. It does not report modifier keys on mouse buttons due to practical considerations. Fixes #714, #506.
2018-03-09Fix benchmarksChristian Duerr
2018-03-04Remove all instances of unwrap() from configChristian Duerr
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)
2018-02-28Update arraydeque dependencyAndy Lok
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-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-02Add support for set-clipboard. (#970)Geert Jansen
This allows e.g. tmux to set the clipboard via the OSC 52 escape code.
2017-12-24Refactor populate cursor, fix-wide-cursor (#762)Oliver Uvman
Cleanup cursor handling code and support wide cursors
2017-12-24Change mouse cursor on terminal mode change (#865)Dustin
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.
2017-12-24Adding dynamic_title property to configuration (#819)Wesley Gahr
This logic is applied in Term's ansi::Handler implementation to avoid unnecessary allocations.
2017-12-24Add box cursor to unfocused underline and beamChristian Duerr
Because some people have requested this change, the beam and underline cursors now also transform into an empty box when the terminal loses focus. Like this there is one unique symbol to indicate that a terminal is not currently focused.
2017-12-24Add custom box cursor for unfocused windowChristian Duerr
2017-12-24Add custom beam cursorChristian Duerr
In issue jwilm/asacritty#31 a few people complained about Beam cursor being weird with their fonts, so to make all cursors uniform in alacritty, a custom cursor has been added for the Beam too. The beam cursor's height is always the full height of the monospace font glyph bounding box. The width depends on the font size. It is calculated using the width of the cell and dividing it by two. The block is always aligned at the far-left of the cell. The implementation is identical to the one of the underline cursor, but it has been refactored so the glyphs are created in `lib.rs`, which can be used by darwin/macos to implement these features too. A small bug in the underline cursor has also been fixed, until now the width was just using the width of the unicode character. Now it should be using the full width of the monospace glyph bounding box with every font. Here are some screenshots for the Beam cursor: ![Small](https://u.teknik.io/v1QH3.png) ![Normal](https://u.teknik.io/RTlp2.png) ![Big](https://u.teknik.io/DLu2M.png) ![Huge](https://u.teknik.io/pSAFX.png)
2017-12-24Update comment to reference proper characterChristian Duerr
The unicode character comment has been updated to correctly reference the character instead of commenting on the variable that might be that character.
2017-12-24Revert to old system for macosChristian Duerr
Because rendering with macos works differently, the old underline cursor is used for that. The cursor symbol has also been setup as a constant in the font project.
2017-12-24Add custom underline cursorChristian Duerr
As mentioned in jwilm/alacritty#931, it can be troublesome if a font has an underline symbol outside of the glyph's bounding box. This can lead to the underline disappearing at the bottom of the terminal. As a solution a symbol from the private use area was used as the character code for the underline symbol. Whenever this symbol is encountered, instead of rendering it, a custom block is rendered. In this implementation the block has the full character as width and sits flush with the bottom of the glyph's bounding box. The height is half the distance between the baseline and the bottom of the bounding box.
2017-12-23Update bitflags to v1Chet Gurevitch
2017-12-22Assure that newlines are in selections (#777)Dustin
When a selection was made, the last line of the selection did not include a new line character when the line ending was selected. This would occur if only one line was selected; if multiple lines were selected, only the final line did not include a newline. This commit updates the `string_from_selection` function to attempt to append a newline character in all places where they are suitable. Because of the simplification of newline insertion, several trait implementations were removed.
2017-12-22Style nitsJoe Wilm
2017-12-22Implement faux scrollingChristian Duerr
This patch implements faux scrolling inside the alternate screen buffer. Whenever the user scrolls up or down while the alternate screen buffer is active, instead of actual scrolling three up/down arrow keys are inserted.
2017-12-03Add cursor style option (#928)Christian Duerr
The default cursor can now be configured through the cursor_style field of the config. Valid options include Block, Underline, and Beam. The default can be restored by sending \e[0q as in VTE terminals. Live config reloading is supported for this parameter.
2017-11-11Match LF behavior outside scroll region with urxvtJoe Wilm
Outside of a scroll region, linefeed will still advances the line until reaching the bottom row in other terminals. Alacritty now matches that.
2017-11-11Correct linefeed handling when scroll region set (#855)Yan
Linefeeds should only move the cursor down if it's before the end of the scroll region. The "out of bounds" panic was triggered by linefeeds going off the bottom of the screen when the scroll region end was above the cursor. Note: https://vt100.net/docs/vt102-ug/chapter5.html "Characters added outside the scrolling region do not cause the screen to scroll."
2017-10-30fix some typos in commentsMartin Lindhe
2017-10-21Set urgent WM flag on bell on X11 systems (#812)Barret Rennie
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.
2017-10-21Fix solid background color opacity (#847)Joe Wilm
Since landing the patch adding transparency support to Alacritty, there's been an issue where othewise solid background cells were also being rendered partially transparent. Now, all filled background cells are rendered fully opaque. Some logic was added to support discarding filled backgrounds which had the same color as the default background. This means that, if the default background is #000 and a cell has that background, it will never be rendered opaque. This may not be correct. Note that many truecolor vim color schemes print spaces for default colored background cells. Performance can be dramatically improved by using ctermbg=NONE guibg=NONE to skip rendering those cells.
2017-10-14Implement user actions for font resize (#625)Dan Aloni
Adds support for font resizing at run-time. Three new actions are introduced: * IncreaseFontSize - Increases current font size by 1.0 * DecreaseFontSize - Decreases current font size by 1.0 * ResetFontSize - Resets font size to that specified in the configuration. The stock config files have example configuration for each which should match gnome-terminal. For convenience, the config entries are: - { key: Key0, mods: Control, action: ResetFontSize } - { key: Equals, mods: Control, action: IncreaseFontSize } - { key: Subtract, mods: Control, action: DecreaseFontSize }
2017-10-14Fix resize behaviorJoe Wilm
Should prevent the messed up background colors that appear in some situations (especially on tiling WMs).
2017-09-27Use clippy = "*", update, and fix some warnings (#796)Aaron Hill
Because there are so many clippy warnings in the current codebase, this commit removes '#![cfg_attr(feature = "clippy", deny(clippy))]', to make it easier to fix warnings incrementally.
2017-09-05Update most remaining depsJonathan Schleußer
2017-08-29Fix reloading colors from config (#756)Tuomas Siipola
2017-08-22Fix newline + scroll region bug (#747)Joe Wilm
When a scroll region is active with the cursor below the bottom of the region, newlines should not cause the region to scroll. A ref test was added for this situation to prevent regressions. Thanks @hiciu for reporting and @nicm for the test case. Resolves #745.
2017-08-11Fix smcup/rmcup toggle bugJoe Wilm
Resolves #634.
2017-08-11Rename some variables for clarityJoe Wilm
2017-08-11Fix BCE issues affecting vimJoe Wilm
Now pass more vttests as well. Resolves #123 cc #660 - screenshot there exhibited the problem, but issue is not entirely about the background problem.
2017-07-28Support background and foreground color escape codes (#662)Tuomas Siipola
2017-07-24add support for X input method (#691)Ted Yin
2017-07-20Implement and use ansi attribute CancelBold (#659)ftilde
2017-06-23Add dim color supportJake Merdich
Add support for the VTE 'dim' flag, with additional support for custom-themed dim colors. If no color is specified in the config, it will default to 2/3 the previous (not a spec, but the value other terminals seem to use). The actual dimming behavior brings bright colors to normal and regular colors to the new dim ones. Custom RGB values are not changed, nor are non-named indexed colors.
2017-06-19Update tests for new Selection APIJoe Wilm
2017-06-19Fix unnecessary redraws with active selectionJoe Wilm
Could be cleaned up a bit if there was a wrapper for Option<Selection> that contained this flag. Also fixes a few compiler warnings.
2017-06-19Implement semantic and line selection draggingJoe Wilm
Unlike the regular selection that is by cell, these selection modes highlight either semantic groupings or entire lines while the mouse is dragged.
2017-06-18Fix bright inverse colors (#621)DarkDefender
Fixes #611.
2017-06-18Implement 'backwards tab'Aaron Hill
This escape sequence isn't officially documented anywhere, but is supported by xterm and gnome-vte.