aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
AgeCommit message (Collapse)Author
2017-06-11Add support for Beam, Underline cursorsJoe Wilm
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-05-01Support setting _NET_WM_PID in X11 environmentsJoe Wilm
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-03-02Add support for wide charactersJoe Wilm
2017-01-26Optimize glyph cache accessJoe Wilm
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-24Use clap as cli parser.Kurnevsky Evgeny
2017-01-23Use the log-crate instead of printing to stdoutLukas Lueg
2017-01-23Dynamically generate test harnessSteven Fackler
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-18Remove unnecessary featureOula Kuuva
Proc_macro has been stable since 1.15.0, attribute no longer needed.
2017-01-06Add `nightly` feature, use for `unlikely` intrinsicManish Goregaokar
2017-01-06Remove need for inclusive rangesManish Goregaokar
2017-01-06Remove need for range_contains featureManish Goregaokar
2017-01-06Replace need for drop_types_in_const with lazy_staticManish Goregaokar
2017-01-06Remove need for step_by featureManish Goregaokar
2017-01-06Make plugin feature optionalManish Goregaokar
2017-01-02Real support for placing config in XDG_CONFIG_HOMEJoe Wilm
Resolves #35.
2016-12-22Implement visual component of mouse selectionsJoe Wilm
This adds the ability to click and drag with the mouse and have the effect of visually selecting text. The ability to copy the selection into a clipboard buffer is not yet implemented.
2016-12-16Remove dead codeJoe Wilm
2016-12-16Rustup and clippyJoe Wilm
All of the changes in this commit are due to clippy lints.
2016-12-11Display manages window, renderer, rasterizerJoe Wilm
This is part of an ongoing decoupling effort across the codebase and tidying effort in main.rs. Everything to do with showing the window with a grid of characters is now managed by the `Display` type. It owns the window, the font rasterizer, and the renderer. The only info needed from it are dimensions of characters and the window itself for sizing the terminal properly. Additionally, the I/O loop has access to wake it up when new data arrives.
2016-12-11Cleaning up main; Added window moduleJoe Wilm
Adds a wrapper for the glutin::Window which provides strongly typed APIs and more convenient interfaces. Moves some gl calls into the opengl-based renderer. The point of most of the changes here is to clean up main().
2016-12-11Refactor cell selection out of rendererJoe Wilm
The terminal now has a `renderable_cells()` function that returns a `RenderableCellIter` iterator. This allows reuse of the cell selection code by multiple renderers, makes it testable, and makes it independently optimizable. The render API now takes an `Iterator<Item=IndexedCell>` to support both the new renderable cells iterator and the `render_string()` method which generates its own iterator. The `vim_large_window_scoll` ref test was added here because it provides a nice large and busy grid to benchmark the cell selection with.
2016-12-11Refactor limit functionJoe Wilm
Was reading through the code and realized this function could be cleaned up significantly.
2016-11-19Add support for recording/running ref testsJoe Wilm
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`.