aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-01-01Improve error handling for clipboard actionsJoe Wilm
Previously, these could have crashed alacritty. Now, they simply print an error message in Red to stderr. The Red format wrapper was moved to a central location where both main.rs and the alacritty lib can access it.
2017-01-01Add support for SGR mouse reportingJoe Wilm
According to: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
2016-12-31Print nice error messages for font loading errorsJoe Wilm
Resolves #22.
2016-12-31Propagate font rasterizer errorsJoe Wilm
This allows consumers of the font crate to handle errors instead of the library panicking.
2016-12-30Add ffi-util crate and use in fontconfig wrapperJoe Wilm
This cleans up and fixes the C-type wrapping for fontconfig.
2016-12-30Refactor FontConfig wrappersJoe Wilm
There's now a proper wrapper in place for working with the FontConfig library. This should help significantly with error handling with font loading; at least, the FontConfig code shouldn't panic. The FreeType rasterizer still needs to be updated to handle missing fonts, and a more sensible default font should be specified.
2016-12-29Improve RenderableCellsIter performanceJoe Wilm
Also adds a benchmark for cell.reset().
2016-12-29Add Default impl for CellJoe Wilm
Just a bit of cleanup.
2016-12-29Fix pty read sometimes not triggering drawJoe Wilm
There was a lot of complexity around the threadsafe `Flag` type and waking up the event loop. The idea was to prevent unnecessary calls to the glutin window's wakeup_event_loop() method which can be expensive. This complexity made it difficult to get synchronization between the pty reader and the render thread correct. Now, the `dirty` flag on the terminal is also used to prevent spurious wakeups. It is only changed when the mutex is held, so race conditions associated with that flag shouldn't happen.
2016-12-29Fix some bugs with selectionsJoe Wilm
Moving the window on macOS would cause a panic in certain circumstances.
2016-12-29Implement clipboard store for x11 with xclipJoe Wilm
2016-12-29Add super hacky underline drawingJoe Wilm
Using underscores because it's easy. It's also wrong. cc #11
2016-12-29Hopefully fix read not triggering drawJoe Wilm
The terminal mutex is no longer released between event processing and doing a draw. This may fix the race condition with data arriving but not being displayed until a subsequent event. cc #29
2016-12-29Unify Cursor, Location and name it PointJoe Wilm
2016-12-29Add silver searcher ignore fileJoe Wilm
Searching on the ref tests would find matches in the terminal recording files and completely screw up the screen state.
2016-12-29Fix selection copy for long linesJoe Wilm
Long lines were previously broken at the terminal width. Now, a wrapping marker is kept on the final cell so that extra newlines are not inserted.
2016-12-27Minor cleanup in main()Joe Wilm
2016-12-27Fix bug with config reloadingJoe Wilm
The reloaded config was not used immediately.
2016-12-26Implement copying selection for macOSJoe Wilm
Still need automatic loading into selection copy buffer for linux.
2016-12-26Refactor bindings and fix binding testsJoe Wilm
The somewhat redundant KeyBinding and MouseBinding types were removed in favor of a Binding<T> type. This allows all binding code to be reused for both scenarios. The binding tests were fixed by only asserting on `is_triggered_by()` instead of checking that the action escape sequence was delivered properly.
2016-12-26Major cleanup for event handlingJoe Wilm
The event handling code grew organically over time, and with that came a number of warts. The primary issue was with passing some random selection of arguments to the input::Processor based on what the input was. There was the issue that if multiple events were drained from a single PollEventsIterator, the terminal mutex was potentially locked and unlocked many times. Finally, and perhaps most importantly, there was no good way to pass necessary state to the Action executor without going through several API layers. To fix all that, the input::ActionContext and input::Processor are now generated once per call to the event::Processor. The input::Processor holds onto the ActionContext so that it doesn't need to be passed through layers of function calls. When a binding is activated, the ActionContext is simply passed to the handler. This did have the effect of breaking the input::Processor tests (specifically, those relating to bindings). The issue was not addressed in this commit since a larger refactor of the bindings is planned which should also improve testability.
2016-12-25Refactor input processing to take action contextJoe Wilm
Various functions take some permutation of the current selection, the terminal, and a notifier. Instead of having to juggle some number of arguments everywhere, the `ActionContext` is constructed and then passed around.
2016-12-24Implement copypasta::Store for macOS pasteboardJoe Wilm
Only works with strings, currently.
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-16Fix config reloadingJoe Wilm
The main refactor broke config reloading; specifically, colors were not updating for subsequent draws.
2016-12-16Remove dead codeJoe Wilm
2016-12-16Misc formatting fixesJoe Wilm
2016-12-16Remove outdated and no longer correct docJoe Wilm
2016-12-16Replace remaining use of `try!` with `?`Joe Wilm
2016-12-16Rustup and clippyJoe Wilm
All of the changes in this commit are due to clippy lints.
2016-12-16Merge pull request #27 from quininer/ref_fish_ccJoe Wilm
add fish_cc ref
2016-12-16add fish_cc refquininer kel
and update Cargo.lock
2016-12-15Handle overflow in Term::move_backwardJoe Wilm
Resolves #25
2016-12-12Remove need for Rc<RefCell<_>> usageJoe Wilm
This adds a trait OnResize and a separate method handle_resize to the display. Instead of having a callback to receive resize events, a list of &mut OnResize are passed to this new method. Doing this allowed the only RefCell usage in the codebase to be removed :).
2016-12-12Fix a couple of compiler warningsJoe Wilm
2016-12-11Track terminal cells on mouse movementJoe Wilm
The cell under the cursor is now tracked in the input processor at `self.mouse.line` and `self.mouse.column`. This could probably be optimized to only compute the cell when in certain states, but the calculation is cheap.
2016-12-11Update nightly pin on travisJoe Wilm
2016-12-11Implement mouse scrolling with line deltasJoe Wilm
This makes scrolling work for mouse wheels (was previously just trackpads).
2016-12-11Finish main.rs cleanupJoe Wilm
* config::Monitor is more ergonomic and self-contained * Fixed an issue with macOS resize. Previously, the terminal was marked as dirty in the window resize handler, but the display can't do that. Instead, the event processor returns a flag whether it was requested to wakeup.
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-11Add run() function and document itJoe Wilm
The doc comment outlines my plan about cleaning up this function.
2016-12-11Add display impl for Points<T>Joe Wilm
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-11Move config path into Config typeJoe Wilm
This cleans up the Config::load API significantly. Several miscellaneous comments were also added.
2016-12-11Cleanup cli option parsingJoe Wilm
This introduces the `cli` module and the `cli::Options` type. This type holds all the options passable on the command line in addition to providing arg parsing.
2016-12-11Force drawing when config reloadsJoe Wilm
2016-12-11Implement Handler::identify_terminal for TermJoe Wilm
The identify_terminal function signature had to change to support writing to the terminal before processing additional input.
2016-12-11Add comments in main loopJoe Wilm
2016-12-11Borrow glutin::Window instead of using ArcJoe Wilm
glutin::Window is not threadsafe; putting it into an Arc is misleading (although the glutin::Window type claims to be Send + Sync). The reference was just needed on the main thread anyway, so it's better to just pass a ref around directly.
2016-12-11Refactor color list managementJoe Wilm
There's now a ColorList type that provides strongly typed indexing for not only usize but NamedColor as well. Previously, the `NamedColor` was casted to a `usize` when indexing the colors. Additionally, only one copy of the ColorList needs to exist;it's borrowed from the `Config` when rendering, and the renderer doesn't need a copy.