Commit Graph
767 Commits
Author SHA1 Message Date
Christian Duerr f8c833ea66 Add faux_scrolling back to scrollback 2018-03-12 22:55:57 -07:00
Christian Duerr e472aa0cb4 Provide correct default for scroll_history
When implementing fallback to the default value with an u32 you will get
0 as the default value.

However the default scrollback value is 10_000. A custom deserializer
has been implemented which automatically falls back to the correct
default value.
2018-03-09 09:47:21 -08:00
Christian Duerr 52ebf3e6ec Add failure_default deserializer to scroll_history 2018-03-09 09:47:21 -08:00
Joe Wilm ec49105203 Fix 4+ line copying 2018-03-08 20:12:48 -08:00
Joe Wilm 80f46cc59f Disable LTO
It's nice to be able to use incremental compilation for release builds.

TODO quantify performance impact.
2018-03-08 20:12:22 -08:00
Joe Wilm 8520a280f7 Add SCROLL_MULTIPLIER
Scroll wheel needs some scaling so it feels like urxvt and friends.
2018-03-07 09:56:19 -08:00
Joe Wilm 143c28953c Support selections with scrolling buffer
Selections now *mostly* work. They move as the buffer scrolls, copying
works as it should, and it looks like the different selection modes
behave properly as well.

The new Selection implementation uses buffer coordinates instead of
screen coordinates. This leads to doing a transform from mouse input to
update the selection, and back to screen coordinates when displaying the
selection. Scrolling the selection is fast because the grid is already
operating in buffer coordinates.

There are several bugs to address:

* A _partially_ visible selection will lead to a crash since the drawing
  routine converts selection coordinates to screen coordinates. The
  solution will be to clip the coordinates at draw time.
* A selection scrolling off the buffer in either direction leads to
  indexing out-of-bounds. The solution again is to clip, but this needs
  to be done within Selection::rotate by passing a max limit. It may
  also need a return type to indicate that the selection is no longer
  visible and should be discarded.
* A selection scrolling out of a logical scrolling region is not
  clipped. A temporary and robust workaround is to simply discard the
  selection in the case of scrolling in a region.

wip selections

fix issue with line selection

selection mostly working

need to support selection not being on the screen at draw time

Fix selection_to_string

Uncomment tests
2018-03-07 09:51:51 -08:00
Joe Wilm 2cfdd595f1 Move selection into Grid
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.
2018-03-07 09:51:06 -08:00
Joe Wilm 69f533d19e Style cleanup 2018-03-07 09:50:46 -08:00
Joe Wilm 40298c50e2 Fix scrolling backwards in tmux 2018-03-07 09:47:21 -08:00
Joe Wilm 5c648a34aa Make number of scrollback lines configurable 2018-03-07 09:47:21 -08:00
Joe Wilm 001b780dda Scroll to bottom on character received 2018-03-07 09:47:21 -08:00
Joe Wilm 96da93efd6 wip fix scroll_down 2018-03-07 09:47:21 -08:00
Joe Wilm 8854124ff0 Fir cursor not scrolling 2018-03-07 09:47:21 -08:00
Joe Wilm 751ef349b8 Add scrolling limit and update on grow lines 2018-03-07 09:47:21 -08:00
Joe Wilm cfc4ebfd6a checkpoint: very basic scrolling works
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-03-07 09:47:21 -08:00
Joe Wilm 6d1d41f8c7 wip scrollback 2018-03-07 09:46:18 -08:00
Joe Wilm 7af765502f Remove some unused impls 2018-03-07 09:46:18 -08:00
Joe Wilm debf6003b5 Minor improvements 2018-03-07 09:46:18 -08:00
Joe Wilm be89dbf30b WIP optimize scroll in region
This intends to optimize the case where the top of the scrolling region
is the top of the screen. In theory, scrolling in this case can be
optimized to shifting the start/end of the visible region, and then
rearranging any lines that were not supposed to be scrolled (at the
bottom of the region). However, this didn't produce quite the speedup I
expected.
2018-03-07 09:46:18 -08:00
Joe Wilm c954b6cb92 Use memcpy for resetting row contents
In addition to a marginal performance improvement, this simplifies some
logic in the Term implementation since now the Grid fully handles row
recycling.
2018-03-07 09:46:18 -08:00
Joe Wilm 2612c9b694 Remove redundant selection::Region type
The type selection::Region was defined identially to std::ops::Range.
Using something other than range just served to confuse.
2018-03-07 09:45:49 -08:00
Joe Wilm 536590dc47 Remove some unused methods and impls 2018-03-07 09:45:25 -08:00
Joe Wilm 971e4b2dc1 Eliminate ClearRegion trait 2018-03-07 09:45:25 -08:00
Joe Wilm 65fba02516 Move grid Row and tests into submodules
This is part of some cleanup for the grid module as a whole.
2018-03-07 09:45:25 -08:00
Joe Wilm 7298b58e74 Back Grid with VecDeque
VecDeque offers improved performance beyond a plain Vec for common
scrolling situations (full screen scroll). Additionally, VecDeque is
necessary for performant scrollback since recycling old rows for a Vec
would be expensive (push/pop front would shift entire vec).
2018-03-07 09:45:25 -08:00
Joe Wilm d0a58c54c5 Cleanup style 2018-03-07 09:45:25 -08:00
Christian Duerr 7f2b398ad2 Remove all instances of unwrap() from config
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-03-04 22:40:15 +00:00
Andy Lok 475ebecfc4 Update arraydeque dependency 2018-02-28 20:33:29 +00:00
Sam Rijs 8045737d58 Upgrade dependencies
Upgrading glutin to the latest version allows building alacritty even
with old XRandr versions.

This is relevant for Debian machines (and other ancient systems).
2018-02-28 19:52:42 +00:00
MindTooth 0afc86cba0 Fix heading for NixOS/Nixpkgs
The level of heading were one to high.
2018-02-27 18:57:19 -08:00
Oliver Jan Krylow 03f9e0cd9a Add install instructions via cargo --git 2018-02-13 16:36:25 +00:00
Saugat Acharya dddf66467c Add info about default configuration for macOS 2018-02-13 16:20:57 +00:00
Steven Noble 107b615d7e starting not staring (#1074) 2018-02-11 09:50:52 -08:00
Joe Moon cc87390ede fix fallbacks in macos (#1099)
fixes #1086
2018-02-07 08:53:58 -08:00
Jeff Muizelaar 2466f81d5e Update core-text (#1061)
This cleans up a bunch of code.
2018-01-31 09:03:24 -08:00
Christian Duerr 53a5a96fdd Update lockfile
Updated the lockfile to make sure clippy is building properly with the
latest nightly toolchain.
2018-01-30 18:59:17 +00:00
golem131 b82622e994 Update dependencies
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-26 20:20:42 +00:00
Rachel K 59b561b440 Better character cell width with FreeType (#1029)
This should fix #1020, #710, and #902
2018-01-21 13:29:57 -08:00
Christian Duerr b396a9a753 Implement reset_state of Term struct (#1035)
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-18 17:27:07 +00:00
Christian Duerr 692cdef9e3 Update lockfile (#1031)
The lockfile has been updated to make clippy work with nightly again.
2018-01-16 12:29:54 -08:00
Christian Duerr 2b5de00241 Spawn alacritty window as invisible
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-15 16:19:32 +00:00
Christian Duerr 8aa8422bcc Update lockfile
Clippy failed to build with the latest nightly, so the lockfile has been
updated to allow the nightly builds to work again.
2018-01-11 16:30:52 +00:00
Christian Duerr f6839a8794 Expand key binding config documentation
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-10 18:36:34 +00:00
Paul Alvarez 632ef0df7f Make Mac app installation steps idempotent (#1015)
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-10 08:54:34 -08:00
Christian Duerr 02953c2812 Fix ioctl call failing on 32 bit architecture (#1011) 2018-01-08 22:49:01 +00:00
Niklas Claesson bd9123e7df Fix indexed color setting regression
Commit 2920cbe710 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-08 13:07:30 +00:00
Christian Duerr cc07624e99 Revert #987 behavior on macos (#1007) 2018-01-07 20:46:11 -08:00
Giorgio Gallo c93d2b1a2d Non-bracketed paste support for DOS CRLFs.
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-07 13:11:46 -08:00
Giorgio Gallo bb3da150de Resolves #733.
When pasting in non-bracketed mode, LFs are replaced with CRs.
2018-01-07 13:11:46 -08:00