Commit Graph
805 Commits
Author SHA1 Message Date
Christian Duerr a2f127a5e6 Change config file to display the correct default 2018-06-02 09:44:58 -07:00
Christian Duerr dab0eca4a7 Make normal scrolling line amount configurable
It is now possible to configure the amount of lines the viewport should
scroll when using the normal scrolling mode.

This fixes #1160.
2018-06-02 09:44:58 -07:00
Christian Duerr 231ef51365 Fix crash when selection leaves viewport
There was an issue where alacritty tries to convert the lines in a
selection to the on-screen lines even when the selection is not on the
screen. This results in a crash.

To prevent this from happening the selection now is not shown if it is
off the screen.

There currently still is a bug that when the selection is at the top of
the screen but still half visible, it will not show the top line as
selected but start in the second line.
This bug should be resolved with
https://github.com/jwilm/alacritty/pull/1171.

This fixes #1148.
2018-06-02 09:42:08 -07:00
Christian Duerr 786e274dd1 Disable faux scrolling when shift is pressed
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-06-02 09:42:08 -07:00
Christian Duerr 9a5a0ec546 Add faux_scrolling back to scrollback 2018-06-02 09:40:07 -07:00
Christian Duerr 04086186a0 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-06-02 09:36:27 -07:00
Christian Duerr dd60ea563d Add failure_default deserializer to scroll_history 2018-06-02 09:36:27 -07:00
Joe Wilm 0484a07fe1 Fix 4+ line copying 2018-06-02 09:36:27 -07:00
Joe Wilm c006dae161 Disable LTO
It's nice to be able to use incremental compilation for release builds.

TODO quantify performance impact.
2018-06-02 09:36:27 -07:00
Joe Wilm 452126013e Add SCROLL_MULTIPLIER
Scroll wheel needs some scaling so it feels like urxvt and friends.
2018-06-02 09:36:12 -07:00
Joe Wilm 8018dee181 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-06-02 09:34:28 -07:00
Joe Wilm 8ef062efd9 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-06-02 09:34:28 -07:00
Joe Wilm ef3c384540 Style cleanup 2018-06-02 09:32:29 -07:00
Joe Wilm 54d50ed3be Fix scrolling backwards in tmux 2018-06-02 09:32:29 -07:00
Joe Wilm c49a7e88f6 Make number of scrollback lines configurable 2018-06-02 09:32:29 -07:00
Joe Wilm 7fe67743eb Scroll to bottom on character received 2018-06-02 09:32:29 -07:00
Joe Wilm f67b17ca7b wip fix scroll_down 2018-06-02 09:32:29 -07:00
Joe Wilm 9b9b138bac Fir cursor not scrolling 2018-06-02 09:32:29 -07:00
Joe Wilm 5748066b8a Add scrolling limit and update on grow lines 2018-06-02 09:32:29 -07:00
Joe Wilm 45c2b3fbf7 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-06-02 09:32:29 -07:00
Joe Wilm 94796a70fc wip scrollback 2018-06-02 09:24:38 -07:00
Joe Wilm 84769ce170 Remove some unused impls 2018-06-02 09:24:38 -07:00
Joe Wilm 92b11cfa43 Minor improvements 2018-06-02 09:24:38 -07:00
Joe Wilm f13685918f 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-06-02 09:24:38 -07:00
Joe Wilm 350bb8c800 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-06-02 09:24:38 -07:00
Joe Wilm a88961bbf0 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-06-02 09:24:38 -07:00
Joe Wilm 4ed25009c4 Remove some unused methods and impls 2018-06-02 09:24:38 -07:00
Joe Wilm 6fc0e1ec49 Eliminate ClearRegion trait 2018-06-02 09:24:38 -07:00
Joe Wilm 277425956f Move grid Row and tests into submodules
This is part of some cleanup for the grid module as a whole.
2018-06-02 09:24:38 -07:00
Joe Wilm bbe276e3a8 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-06-02 09:24:38 -07:00
Joe Wilm fd7c1bf663 Cleanup style 2018-06-02 09:24:38 -07:00
Tatsuyuki Ishi 2fcdd40a81 Reduce debug level for release
Backtraces are useful, but line-level debuginfo bloats the binary, and has impact on compile times notably. This reduces it to function-level debuginfo which is a good compromise point.
2018-05-30 10:23:03 -07:00
Francesca Frangipane 765949f256 Update to glutin 0.16.0
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.
2018-05-29 09:50:49 -07:00
Randy Ramos f7172fd6e7 Fix typo in error message 2018-05-25 20:51:55 +00:00
Bradford Boyle 4d4e62db92 Fix locale_id for older versions of OS X (<= 10.11)
This fixes a regression introduced in https://github.com/jwilm/alacritty/pull/1087/files#diff-5ffadea12561d6964b05ac2a0b8e388fL33.
2018-05-25 13:57:47 +00:00
Joe Moon 24e8a19e7d handle older macOS versions
add logic to fallback to `localeIdentifier` if
`currentLocale.languageCode` and `currentLocale.countryCode` are not
available.
2018-05-14 12:37:13 -07:00
Joe Moon 75529be729 macos: add check for valid locale 2018-05-14 12:37:13 -07:00
Joe Moon f818109856 remove commented out line 2018-05-14 12:37:13 -07:00
Joe Moon 1c08fae156 Set $LANG env var using languageCode, countryCode
fixes #933

Using logic from https://github.com/gnachman/iTerm2/blob/79aff4d59fd591e7628649bcabe5f27541740bf6/sources/PTYSession.m#L1703
2018-05-14 12:37:13 -07:00
Christian Duerr e34dccdabf Fix clippy lints 2018-05-11 16:54:19 -07:00
Christian Duerr 5728136350 Paste path into terminal when drag & dropping file
It's now possible to insert the path of a file or directory by dropping
it from the file manager into alacritty.

This fixes #1301.
2018-05-11 16:54:19 -07:00
Christian Duerr 5be0e3ad8f Don't paste selection when in mouse mode
When the mouse mode is set using either 1000h, 1002h or 1003h, the
selection should not be pasted when hitting the middle mouse button,
because it is job of the application to handle this when mouse mode is
enabled.

This has been solved by checking for the current mouse modes whenever
the `PasteSelection` binding is invoked.

This fixes #1215.
2018-05-05 08:10:57 -07:00
zhouji e2abd8945a Fix completion install instructions for Fish on macOS (#1237) 2018-05-01 10:58:52 -07:00
Joe Moon abe678c686 macOS: fixes segfault on nightly
fixes #1264
2018-04-27 17:36:39 -07:00
Matt T. Proud 1b7ffea136 alacritty: add support for OpenBSD.
This commit expands the conditional compilation directives to support
building Alacritty for OpenBSD.  The build succeeds, and Alacritty runs
without issue once https://github.com/rust-lang/libc/pull/957 has been
merged and added to a versioned libc release.

This has been tested on the recently-released OpenBSD 6.3 on amd64 with
rustc 1.24.0 from its standard ports tree.
2018-04-14 10:17:50 -07:00
Bernardo Meurer 3d75c49191 Oxford comma
Added an Oxford comma to the OS support list
2018-03-29 19:47:39 -07:00
Bernardo Meurer b0be5b6bc0 Fixed typos, alphabetical ordering
freeBSD->FreeBSD.
Ordered OS support alphabetically.
2018-03-29 19:47:39 -07:00
MatthiasSchuster fff0e11faa add freeBSD on the top 2018-03-27 09:58:18 -07:00
Saugat Acharya dcc4b75038 Fix typo 2018-03-23 10:20:35 -07:00
Harlan Lieberman-Berg 0edac74e61 Explicitly call log::set_max_level (Closes: #1201)
For some reason, log 0.4 requires that we explicitly set the log level
with log::set_max_level or it defaults to Off.  The documentation
isn't clear but suggests we must do this in addition to doing the
filtration ourselves in the Log impl.
2018-03-22 18:10:27 -07:00