aboutsummaryrefslogtreecommitdiff
path: root/src/input.rs
AgeCommit message (Collapse)Author
2018-04-02Fix selection testsChristian Duerr
The latest selection changes broke a few tests, these have been corrected. Two of these tests were broken because they assumed different span types, the test have been changed here because the result was correct. One test did actually catch a bug where selection of two cells from right to left would incorrectly mark the cells as selected even though they should not have been, this has been fixed in the `simple_span` method.
2018-03-23Rework auto-scrolling optionsChristian Duerr
This changes two things, the first thing it does is that now whenever a keybinding sends an escape sequence, the viewport is automatically scrolled to the bottom. This is enabled by default and fixes #1187. The second thing is automatic scrolling when a command writes to the terminal. So when running a command like `sleep 3; ls -lah`, alacritty will scroll to the bottom once the output is sent, even if the viewport is currently not at the bottom of the scrollback. Because this can have an impact on performance, and is not enabled by default in terminals like iTerm or Termite (VTE), it is an opt-in setting in the config.
2018-03-15Replace scrolling methods with enumChristian Duerr
The different scrolling methods added a bunch of boilerplate where the call was just forwarded to the next struct, this has been removed by making the scroll amount into a struct. Now everything is called through one method and the parameter decides how far the viewport should be scrolled.
2018-03-15Add scrollback hotkeysChristian Duerr
This offers a few additional hotkeys that can be used in combination with scrollback. None of these are used by default yet. This implements the following bindings: - ScrollPageUp: Scroll exactly one screen height up - ScrollPageDown: Scroll exactly one screen height down - ScrollToTop: Scroll as far up as possible - ScrollToBottom: Scroll as far down as possible This fixes #1151.
2018-03-13Fix multi-line selection with single cell endChristian Duerr
When the user selected multiple lines, dragging the selection downwards, and then leaves the cursor to the left side of the first cell, the first cell was still incorrectly selected. This has been fixed. The selection also did not update if the mouse was outside of the window, now all movement events are accpeted even when the mouse is outside of the window. This allows updating the selection when the user is dragging the cursor too far. Mouse movement and click events outside of the window are not propagated, these are only used for updating the selection.
2018-03-13Fix selection in scrollbackChristian Duerr
There were a few issues with selection in scrollback that were mainly off-by-one errors. This aims at fixing these issues. This also fixes a bug that currently exists in master where the last cell is not selected when the mouse leaves the window to the right.
2018-03-13Fix linux config default valueChristian Duerr
2018-03-13Merge branch #1095Christian Duerr
Because there was some overlap with branch #1095, these two PRs have been added together and the config has been restructured to make use of a `scrolling` section. The default faux scrolling amount has also been changed to `3` because this simplifies the code and falls in line with what most other terminal emulators do. There should be no additional test failures due to this.
2018-03-13Make normal scrolling line amount configurableChristian Duerr
It is now possible to configure the amount of lines the viewport should scroll when using the normal scrolling mode. This fixes #1160.
2018-03-12Disable faux scrolling when shift is pressedChristian Duerr
To make it possible to access the native scrollback buffer in the alternate screen without having to disable faux scrolling, faux scrolling is now disabled when the `shift` key is held down. This should allow alacritty to have the best of both worlds, a native scrollback buffer in the alternate screen buffer and faux scrolling.
2018-03-12Add faux_scrolling back to scrollbackChristian Duerr
2018-03-07Add SCROLL_MULTIPLIERJoe Wilm
Scroll wheel needs some scaling so it feels like urxvt and friends.
2018-03-07Scroll to bottom on character receivedJoe Wilm
2018-03-07checkpoint: very basic scrolling worksJoe Wilm
Things that do not work - Limiting how far back in the buffer it's possible to scroll - Selections (need to transform to buffer offsets)
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-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-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-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.
2018-01-02Allow faux scroll amount configurationChristian Dürr
It is now possible to configure the amount of lines scrolled with faux scrollback.
2018-01-02Add config option for faux scrollbackChristian Dürr
Some people have complained about the behavior of faux scrollback inside of vim/tmux, however from what I can tell, alacritty behaves the same way as other terminal emulators that support faux scrollback. However there are a lot of terminal emulators that do not support faux scrollback at all, which leads to people complaining about unusual scroll behavior. This is my proposal on how to solve this issue, by giving people that do not like the VTE-Style faux scrolling the option to opt-out.
2017-12-29Fix zombie children (#976)Joe Wilm
Resolves #973
2017-12-23Update bitflags to v1Chet Gurevitch
2017-12-22Style nitsJoe Wilm
2017-12-22Adapt pixel-based scrolling behaviorChristian Duerr
The pixel-based scrolling behavior has been adapted to be as similar to the line-based one as possible. I still have not been able to test this. But this should have a decent chance to at least kinda work.
2017-12-22Fix faux scrolling for line-based touchpadsChristian Dürr
Touchpads which use line-based instead of pixel-based updates send partial scroll requests, so decimal numbers are important. The current implementation only really used scroll amounts that are either 1 or -1. This has been fixed and now the line-based touchpads should have very smooth scrolling, but the pixel-based approach is still WIP and completely untested.
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-10-22Rewrite err_println to eprintln introduced in Rust 1.19 (#799)Roel
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-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-02Fix #721: touchpad scrolling (#726)Linus Heckemann
2017-07-20Update to latest Glutin/winit (#671)Joe Wilm
* Update to latest Glutin/winit This *finally* gets us off the fork of Glutin we've been on for so long and will unblock a number of other items. Functionality should be the same as before. The update forced our hand on a compiler update. It's no longer feasible to pin on an old version. From now on, we require latest stable.
2017-06-19Update tests for new Selection APIJoe Wilm
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-06Fix selection when padding is presentTuomas Siipola
2017-05-29Implement FocusIn/FocusOut reports (#589)Aaron Hill
Implements sending FocusIn/FocusOut events, as defined at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-FocusIn_FocusOut
2017-05-25Add support for running commands on key press (#566)Dominik Miedziński
Based on option `command` in key binding section in config, e.g. - { key: N, mods: Control|Shift, command: alacritty } # or - { key: N, mods: Control|Shift, command: { program: "alacritty", args: ["-e", "vttest"], }} specified command will be run in the background on key press. Alacritty doesn't wait for its result nor block IO.
2017-05-06Add window padding optionTuomas Siipola
Padding can be configured by using the `padding` field in the config file, like so: padding: x: 2 y: 2 which would result in a 2px padding within each side of the window.
2017-02-07Semantic SelectionXiaoyu Yin
Fix tests and add line select Refactor BidirectionalIter to remove if blocks Allow for cells tagged with WRAPLINE to continue expanding the selection Reorganize config into structs Add test coverage that callbacks are called Cleanup mouse config - Uses Duration type for ClickHandler::threshold - Removes `action` property from ClickHandler--this can be added in a backwards compatible way later on - Renames ClickState::DblClick to DoubleClick fixup! Cleanup mouse config
2017-02-06Send mouse wheel commands only if they're supportedTuomas Siipola
Fixes #48
2017-02-05Add "Quit" action to allow exit on a Cmd-W or Cmd-QBrandur
Adds a new "Quit" action and binds it to Cmd-W and Cmd-Q on Mac OS in an attempt to make Alacritty feel more like a "normal" citizen of the operating system. Alternatives like Ctrl-D are okay, but I usually want to leave my shells nested within Tmux open even if I exit my terminal. It's also largely selfish: I've built up muscle memory over the years that takes my fingers to Cmd-Q first (and I suspect I'm not the only one). The implementation for an exit is copied from `event.rs` which notably is already tagged with a FIXME. It seems that `tty.rs` contains a `process_should_exit` system to help handle a `SIGCHLD`, and it's possible that these two exit implementations should be merged together. I could probably tackle that as my next project. As mentioned in #218, Alacritty can't really spawn other windows right now, so I've tied in Cmd-W as simply another synonym for quitting until that's implemented. Fixes #218.
2017-02-02Decouple input processing from TermJoe Wilm
Should make input processing much more easily tested.
2017-01-30Load the primary clipboard when pastingjc00ke
Paste & PasteSelection are not quite the same. The former should be pulling from the main clipboard where the latter does not.