Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
|
|
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.
|
|
|
|
|
|
The `rustc-test` crate has this feature disabled by default causing all
of the test `println!` output to be displayed.
|
|
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!
|
|
Resolves #23
Resolves #144
|
|
|
|
|
|
|
|
Resolves #35.
|
|
All of the changes in this commit are due to clippy lints.
|
|
|
|
Also adds a feature `err-println` for enabling `err_println!` printing.
|
|
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`.
|
|
Committed this on a plane with no internet; need to get a real glutin
ref pushed somewhere and update this commit before merging into master.
|
|
Which means it can be disabled in release builds. No more working on a
renderer feature and actually breaking the Alacritty your editor is
running inside.
|
|
Now uses serde_dervive \o/
|
|
Resolves #10.
|
|
Currently it only supports x11 via the xclip program, and that only
supports reading the clipboard contents.
|
|
doesn't work on ubuntu 16.04 for some reason
|
|
This was largely an experiment to see whether writing and reading from a
separate thread was causing terminal state corruption as described in
https://github.com/jwilm/alacritty/issues/9. Although this doesn't seem
to fix that particular issue.
Keeping this because it generally seems more correct than
reading/writing from separate locations.
|
|
Also enables debug symbols in release profile by default. Until
Alacritty ships, there's going to be lots of perf analysis which needs
debug symbols.
The PriorityMutex low priority method was never used. Now it's just a
fair mutex.
|
|
|
|
Using the vte crate allows removal of the ansi parser state machine and
enables us to just be concerned with actions described in the protocol.
In addition to making alacritty simpler, this also improves correctness
and performance.
|
|
Currently has a bug where screen is blank at startup. That aside,
Alacritty uses basically 0 CPU now. The input thread is still separate
from the render thread, but, given the ability to wake the event loop,
it may be possible to merge them again. I'm not sure if that's actually
desirable.
Performance is seemingly unchanged.
|
|
Glutin includes GlContext::clear_current() for linux
|
|
To minimize rendering, the input must be handled in a separate thread.
To see, why, consider the optimal rendering solution: renders are only
necessary when the pty has data that changes the terminal state, OR
there is a window event which changes the graphics state. When not
drawing, the render thread is to remain parked at a condition variable,
and it's not possible to handle input while parked! Thus, we need a
separate thread.
In addition to adding the separate thread, each subsystem thread is now
spawned in a separate function to (hopefully) improve readability.
|
|
|
|
This is experimental on a separate branch of Glutin. It's intended to
fix the problem of certain key events not being delivered on alt-tab and
breaking the modifier state tracking.
|
|
Previous version of serde no longer worked; cargo packages were updated
as a result. `Zero` and `One` traits were deprecated. Use of those was
removed. The `Step` trait gained a lot more methods, and the index::$ty
implementations were updated.
|
|
Configuration may now be specified in either `$HOME/.alacritty.yml` or
`$HOME/.config/alacritty.yml`. See `alacritty.yml` in the repository
root for an example.
When a configuration file cannot be located, a default configuration is
used.
|
|
The input/pty processing loop previously consumed input on a channel and
hit the rendering when the queue became empty. This had a couple of
problems
1. It was possible to be overwhelmed with input and not give the
renderer an opportunity to update the screen. This gave the
appearance of locking up.
2. Multiple frames could be rendered for a single vblank (redundant
work)
3. Open loop rendering would inevitably have buffer swapping out of sync
with vblanks and visual tearing would occur.
This commit enables vsync on the glutin window. The rendering was all
moved onto a separate thread from input/pty processing to support vsync.
However, the rendering thread must be 100% synchronized with the updater
thread. There's now a Mutex on the Term, and an atomic bool to ask the
input/pty processing to yield to the renderer.
One aspect of this feature that hasn't been worked out is how to limit
the frame rate. Currently, it just free runs at the screen refresh rate.
The initial attempt here included the input/pty processor holding a lock
while waiting for input. This *almost* worked, but there was a (not
uncommon) edge case where the terminal state was "dirty" but the
renderer was not ready to draw.
Instead of blocking on the refresh issue, it's being punted to after an
MVP is released. The overhead of drawing at 60Hz was profiled to be ~5%
CPU usage, and this is deemed acceptable for an MVP.
|
|
Alacritty now runs on macOS using CoreText for font rendering.
The font rendering subsystems were moved into a separate crate called
`font`. The font crate provides a unified (albeit limited) API which
wraps CoreText on macOS and FreeType/FontConfig on other platforms. The
unified API differed slightly from what the original Rasterizer for
freetype implemented, and it was updated accordingly.
The cell separation properties (sep_x and sep_y) are now premultiplied
into the cell width and height. They were previously passed through as
uniforms to the shaders; removing them prevents a lot of redundant work.
`libc` has some differences between Linux and macOS. `__errno_location`
is not available on macOS, and the `errno` crate was brought in to
provide a cross-platform API for dealing with errno.
Differences in `openpty` were handled by implementing a macOS specific
version. It would be worth investigating a way to unify the
implementations at some point.
A type mismatch with TIOCSCTTY was resolved with a cast.
Differences in libc::passwd struct fields were resolved by using
std::mem::uninitialized instead of zeroing the struct ourselves. This
has the benefit of being much cleaner.
The thread setup had to be changed to support both macOS and Linux.
macOS requires that events from the window be handled on the main
thread. Failure to do so will prevent the glutin window from even
showing up! For this reason, the renderer and parser were moved to their
own thread, and the input is received on the main thread. This is
essentially reverse the setup prior to this commit. Renderer
initialization (and thus font cache initialization) had to be moved to
the rendering thread as well since there's no way to make_context(null)
with glx on Linux. Trying to just call make_context a second time on the
rendering thread had resulted in a panic!.
|
|
Of note are the `ansi` and `grid` modules becoming public. There are
several bits of unused code in each of these. In the case of `grid`, the
unused parts are generally useful, like some indexing implementations.
In ansi, there are pieces that will be used once the parser is more
complete. In any case, these modules are fairly generic and mostly
usable outside of Alacritty.
Unused cargo packages were also removed.
|
|
|
|
Draw calls are now batched for performance. Render times on git log at
the default size are now ~200usec.
|
|
This moves some logic that was previously being done per-character into
the vertex shader. At this time, we've traded CPU computation for
additional gl::Uniform2f calls. This is only a marginal improvement.
However, this patch positions the renderer well for instanced drawing,
and that will be a huge performance win.
|
|
Recompiling the entire program whenever a shader changes is slow, and it
can interrupt flow. Shader reloads are essentially instantaneous now. If
the new shader fails to compile, no state is changed; the previous
program continues to be used.
|
|
Most importantly, freetype-rs was updated to use freetype-sys 0.4 which
includes the LCD_FILTER apis.
|
|
Uses the GL_ARB_blend_func_extended to get single-pass, per-channel
alpha blending. gl_generator is now used instead of gl to enable the
extension.
The background color is removed since that presumably needs to run in a
separate pass.
|
|
|
|
|
|
|
|
This letter brought to you by OpenGL and freetype.
|
|
There are several assumptions made at this point and very little (no)
error handling done.
|
|
This function isn't exactly useful, but it's working ffi with the
fontconfig library. Woo! Next step will be returning some objects with
more information (like font path so we can start rendering glyphs!).
|
|
|