Commit Graph
83 Commits
Author SHA1 Message Date
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
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
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
Christian Dürr b83a26ffe0 Enable shift+select in mouse mode
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-03 11:15:57 -08:00
Geert Jansen 20aa45c878 Add support for set-clipboard. (#970)
This allows e.g. tmux to set the clipboard via the OSC 52 escape code.
2018-01-02 08:32:50 -08:00
chetgurevitch 958a32767f Update glutin to v0.11 2017-12-23 21:39:09 -08:00
Chet Gurevitch 76ca679e89 Update bitflags to v1 2017-12-23 21:39:09 -08:00
Chet Gurevitch ae533e660f Update glutin to v0.10 2017-12-23 21:39:09 -08:00
Chet Gurevitch 1117bb5fda Update deps 2017-12-23 21:39:09 -08:00
Joe Wilm 672ea9b050 Remove built crate
This became a support burden for me due to various compile and run time
issues.
2017-12-22 14:25:14 -08:00
Theodore Dubois 94caa7667d Remove the launcher and set the locale/current directory in alacritty (#879) 2017-12-13 09:52:36 -08:00
hcpl 8a09917dd1 Output more info for --version (#888)
Useful when requesting more info to help investigating issues.
2017-11-11 17:17:47 -08:00
Roel a1174797b4 Rewrite err_println to eprintln introduced in Rust 1.19 (#799) 2017-10-22 08:42:40 -07:00
Joe Wilm 619e877819 Add support for env_logger
When RUST_LOG environment variable is set, uses env_logger instead of
our custom logger. This is desirable for debugging purposes.
2017-10-08 22:20:58 -07:00
Joe Wilm 88c1dabefc Revert "Update glutin & fix a few wayland issues (#815)"
This reverts commit e17d38167e.

Was breaking builds for mac users.
2017-10-06 11:32:53 -07:00
Victor Berger e17d38167e Update glutin & fix a few wayland issues (#815)
This PR fixes a few wayland issues of alacritty (and updates glutin on
the process because it is needed).

Mainly two changes are done:

1. Add a drawing_ready() method on Window: see
https://docs.rs/winit/0.8.2/winit/os/unix/trait.WindowExt.html#tymethod.is_ready
for explanations. Hopefully glutin will be able to handle it itself in
the future, but it currently does not.

2. resize window and OpenGL contextes.

The way wayland forces winit to draw its own decorations and how surface
size is defined by its content means that in practice:

- winit's window.set_inner_size() defines the dimensions of the
  borders
- glutins gl_window.resize() defines the dimensions of the content
  (and is a noop in other platforms)

It is for now glutin's user responsibility to keep them in sync
otherwise borders are drawn stupidly. This PR changes the resize methods
of alacritty::Window to always update both.

This fixed the borders issues for me, tested on weston.
2017-10-06 08:47:51 -07:00
Aaron Hill 5f7885749c Use clippy = "*", update, and fix some warnings (#796)
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-27 17:29:44 -07:00
Jonathan Schleußer a7b50e0eb8 Update notify 2017-09-05 09:07:00 -07:00
Jonathan Schleußer a3d35ec185 Update most remaining deps 2017-09-05 09:07:00 -07:00
Jonathan Schleußer 967393a31c Update servo 2017-09-05 09:07:00 -07:00
Tim Steinbach c4ece6dde3 winit: 0.7.5 -> 0.7.6, glutin: 0.9.1 -> 0.9.2 (#761) 2017-08-28 10:01:19 -07:00
Joe Wilm 49c73f6d55 Use latest winit
Resolves #679
2017-07-21 13:34:52 -07:00
Joe Wilm 8e7dd009a4 Update to latest Glutin/winit (#671)
* 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-07-20 10:50:50 -07:00
Joe Wilm 08b5ae52c1 Revert "Reduce InstanceData footprint"
This reverts commit 3cdba29124.

On some systems, the target commit actually caused a massive performance
issue rather than fixing one.
2017-07-03 19:45:21 -07:00
Joe Wilm 3cdba29124 Reduce InstanceData footprint
The InstanceData type in the rendering subsystem was previously 16
floats which occupied a total of 64 bytes per instance. This meant that
for every character or background cell drawn, 64 bytes were sent to the
GPU. In the case of a 400x100 cell grid, a total of 2.5MB would be sent.

This patch reduces InstanceData's size to 26 bytes, a 60% improvement!
Using the above example for comparison, a worst case of 1MB would be
transferred.

The motivation for this patch comes from macOS. Once the terminal grid
would reach a certain size, performance experienced a sharp and dramatic
drop (render times would go from ~3ms to ~16ms). I don't want to
speculate too much on the underlying issue, but suffice it to say that
this patch alleviates the problem in my testing.
2017-07-01 10:24:50 -07:00
Joe Wilm 529ac47fc8 Add support for Beam, Underline cursors
Notable about this implementation is it takes a different approach for
managing cursor cells that previously. The terminal Grid is now
borrowed *immutably*. Instead of mutating Cells in the Grid, a list is
managed within the RenderableCellsIter. The cell at the cursor location
is skipped over, and instead cells are popped off a list of cursor
cells.

It would be good in the future to share some more code between the
different cursor style implementations for populating the cursor cells
list.

Supercedes #349.
2017-06-11 13:21:13 -07:00
Joe Wilm f051e686da Update dependencies 2017-05-25 10:57:42 -07:00
Joe Wilm 574586045f Support setting _NET_WM_PID in X11 environments
Support is added for setting _NET_WM_PID automatically. This is to
support scripting of the window environment. For example, this makes it
possible to script opening a window with same CWD:

1. Retrieve the current window
2. (new) get PID of window
3. Check if it's Alacritty, find first child (presumably a shell), and
   get the child's cwd.
4. Spawn new instance of terminal with cwd.

Unaddressed in this commit is how this will coexist on a Wayland system.
2017-05-01 08:36:09 -07:00
Joe Wilm 00d271b7e0 Fix bug parsing OSC strings
OSC strings with UTF-8 previously failed.
2017-03-02 09:19:01 -08:00
Joe Wilm 119c7d2856 Add support for wide characters 2017-03-02 09:19:01 -08:00
Joe Wilm 418df72a07 Bump glutin
Resolves #422
2017-02-17 23:16:37 -08:00
Michel Boaventura e0980df48e Updates Glutin to proper handle dead keys
Resolves #211.
2017-02-17 15:28:46 -08:00
Joe Wilm f2f750f9f3 Alacritty now compiles on stable Rust 🎉 2017-02-03 08:11:19 -08:00
Joe Wilm 40d7c0c434 Implement save/restore cursor position
This passes the vttest for save and restore cursor position. The
implementation was done according to:

    http://www.vt100.net/docs/vt510-rm/DECSC.html

As of yet, there are a few things not supported by the terminal which
should otherwise be saved/restored.

vte was updated for a fix with CSI param parsing
2017-02-02 09:07:00 -08:00
Joe Wilm 6d744abf7b Update to serde 0.9 and serde-yaml 0.6. 2017-01-29 17:29:56 -08:00
Joe Wilm 08f348ecea Optimize glyph cache access
Loading a glyph from the cache is a very hot operation in the renderer.
The original implementation would first check if a glyph was loaded and
then call `get()` which would have to search a second time. This showed
up as a very slow point in profiles.

This patch addresses glyph cache access in two ways: by using a faster
hasher optimized for small keys (fnv), and by using the entry API for
fetching a cached glyph. The `fnv` hasher is faster than the default and
is very efficient for small keys. Using the entry API on the HashMap
means only 1 lookup instead of two. The entry API has a downside where
the key needs to get cloned on fetches.

Reducing the GlyphKey width to 64-bits helps in both areas. Copying an
8-byte wide type is very cheap and thus limits downside of the entry
API. The small width also helps with the hasher performance.

Over all, this patch reduced typical render times by several hundred
microseconds on a 2013 MacBook Pro with a full screen terminal full of
text.
2017-01-26 08:43:53 -08:00
Kurnevsky Evgeny 1dca5617e2 Use clap as cli parser. 2017-01-24 08:38:38 -08:00
Lukas Lueg 64b42cd2f3 Use the log-crate instead of printing to stdout 2017-01-23 09:14:01 -08:00
Joe Wilm b23ed6ed4c Capture test output by default
The `rustc-test` crate has this feature disabled by default causing all
of the test `println!` output to be displayed.
2017-01-23 08:59:54 -08:00
Steven Fackler 41f99dc4c0 Dynamically generate test harness
This uses the rustc-test crate, a copy of the standard test crate, to
dynamically create tests for each reference test. No need to remember to
update the macro, just add the directory to ref!
2017-01-23 08:59:54 -08:00
Joe Wilm dfb1b3bb5c Add support for setting title from OSC
Resolves #23
Resolves #144
2017-01-11 09:07:31 -08:00
cody fa73c56245 Enabled Rustc' Link Time Optimization 2017-01-07 23:56:29 -05:00
Manish Goregaokar 49187d53f2 Add nightly feature, use for unlikely intrinsic 2017-01-06 20:28:17 -08:00
Manish Goregaokar ee5a9f1338 Replace need for drop_types_in_const with lazy_static 2017-01-06 20:17:10 -08:00
Joe Wilm a105be82cf Real support for placing config in XDG_CONFIG_HOME
Resolves #35.
2017-01-02 20:05:31 -08:00
Joe Wilm dc918ae71a Rustup and clippy
All of the changes in this commit are due to clippy lints.
2016-12-16 22:13:51 -08:00
Joe Wilm 3db0bcb2a7 Fix glutin wayland 2016-11-19 21:34:22 -08:00
Joe Wilm 0dfba30181 Add a number of simple ref-tests
Also adds a feature `err-println` for enabling `err_println!` printing.
2016-11-19 21:34:22 -08:00
Joe Wilm 66dbd29cd1 Add support for recording/running ref tests
Ref tests use a recording of the terminal protocol and a serialization
of the grid state to check that the parsing and action handling systems
produce the correct result. Ref tests may be recorded by running
alacritty with `--ref-test` and closing the terminal by using the window
"X" button. At that point, the recording is fully written to disk, and a
serialization of important state is recorded. Those files should be
moved to an appropriate folder in the `tests/ref/` tree, and the
`ref_test!` macro invocation should be updated accordingly.

A couple of changes were necessary to make this work:

* Ref tests shouldn't create a pty; the pty was refactored out of the
  `Term` type.
* Repeatable lines/cols were needed; on startup, the terminal is resized
* by default to 80x24 though that may be changed by passing
  `--dimensions w h`.
* Calculating window size based on desired rows/columns and font metrics
  required making load_font callable multiple times.
* Refactor types into library crate so they may be imported in an
  integration test.
* A whole bunch of types needed symmetric serialization and
  deserialization. Mostly this was just adding derives, but the custom
  deserialization of Rgb had to change to a deserialize_with function.

This initially adds one ref test as a sanity check, and more will be
added in subsequent commits. This initial ref tests just starts the
terminal and runs `ll`.
2016-11-19 21:34:11 -08:00