Commit Graph
272 Commits
Author SHA1 Message Date
Alex Burka dcd4e01c22 macOS: cmake is not required
The build Works On My Machine (tm) without cmake. OSX 10.9.5
2017-01-05 01:40:38 -05:00
Joe Wilm 693aefcbd7 Draw the screen when Refresh event arrives
cc #53
2017-01-04 19:54:29 -08:00
Joe Wilm af1ce5b91b Merge pull request #49 from FliegendeWurst/patch-1
Fix typo in README
2017-01-04 12:41:34 -08:00
FliegendeWurst 9a7a6c4e0e Fix typo in README 2017-01-04 21:14:32 +01:00
Joe Wilm 93ee85c9cc Add note about forthcoming blog post 2017-01-04 09:17:56 -08:00
Joe Wilm 79d13c736e Send correct character sequence with alt key
Resolves #46.
2017-01-02 23:47:56 -08:00
Joe Wilm 38a9673eb3 Update README arrow keys FAQ 2017-01-02 20:49:32 -08:00
Joe Wilm 1edfef4a32 Have default mouse and key bindings
This improves the situation where the user has not installed the default
configuration file.

Resolves #42.
2017-01-02 20:42:57 -08:00
Joe Wilm edd5dc7da5 Fix scrolling with SGR mode
Resolves #43.
2017-01-02 20:25:28 -08:00
Joe Wilm 06991e6eee Better error message when xclip is not available
Resolves #37.
2017-01-02 20:15:24 -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 8630185639 Rework font loading
This work started because we wanted to be able to simply say "monospace"
on Linux and have it give us some sort of font. The config format for
fonts changed to accomodate this new paradigm. As a result, italic and
bold can have different families from the normal (roman) face.

The fontconfig based font resolution probably works a lot better than
the CoreText version at this point. With CoreText, we simply iterate
over fonts and check it they match the requested properties. What's
worse is that the CoreText version requires a valid family. With
fontconfig, it will just provide the closest matching thing and use it
(unless a specific style is requested).
2017-01-02 19:49:38 -08:00
Joe Wilm 04d69e3c29 Write README.md 2017-01-02 12:53:08 -08:00
Joe Wilm d8f1750183 Fix rustc-version file 2017-01-01 21:40:18 -08:00
Joe Wilm 7c794ada88 Improve error handling for shader initialization
Shader initialization errors at startup should print a nice message now.
2017-01-01 19:19:15 -08:00
Joe Wilm d4e20a4741 Improve error handling for clipboard actions
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-01 19:09:27 -08:00
Joe Wilm 82bfc41af7 Add support for SGR mouse reporting
According to:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
2017-01-01 18:28:49 -08:00
Joe Wilm a86dfd1a11 Print nice error messages for font loading errors
Resolves #22.
2016-12-31 20:47:29 -08:00
Joe Wilm 2738969f29 Propagate font rasterizer errors
This allows consumers of the font crate to handle errors instead of the
library panicking.
2016-12-31 20:47:02 -08:00
Joe Wilm a00970c9a8 Add ffi-util crate and use in fontconfig wrapper
This cleans up and fixes the C-type wrapping for fontconfig.
2016-12-30 18:55:10 -08:00
Joe Wilm 44c6171bc0 Refactor FontConfig wrappers
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-30 00:34:57 -05:00
Joe Wilm 72ff775b23 Improve RenderableCellsIter performance
Also adds a benchmark for cell.reset().
2016-12-29 21:56:49 -05:00
Joe Wilm 26ac1df0b1 Add Default impl for Cell
Just a bit of cleanup.
2016-12-29 21:43:55 -05:00
Joe Wilm a91a3f2dce Fix pty read sometimes not triggering draw
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-29 21:38:22 -05:00
Joe Wilm b704dafb24 Fix some bugs with selections
Moving the window on macOS would cause a panic in certain circumstances.
2016-12-29 20:53:41 -05:00
Joe Wilm f1336ee1c7 Implement clipboard store for x11 with xclip 2016-12-29 17:57:50 -05:00
Joe Wilm 818a2f6161 Add super hacky underline drawing
Using underscores because it's easy. It's also wrong.

cc #11
2016-12-29 16:05:32 -05:00
Joe Wilm d06360216d Hopefully fix read not triggering draw
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-29 15:34:33 -05:00
Joe Wilm 689e0f4ad7 Unify Cursor, Location and name it Point 2016-12-29 11:09:29 -05:00
Joe Wilm 5ee031f55f Add silver searcher ignore file
Searching on the ref tests would find matches in the terminal recording
files and completely screw up the screen state.
2016-12-29 10:49:12 -05:00
Joe Wilm 115a4085b4 Fix selection copy for long lines
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-29 10:43:58 -05:00
Joe Wilm 0f1c742857 Minor cleanup in main() 2016-12-27 22:47:25 -05:00
Joe Wilm 8af19c3f0c Fix bug with config reloading
The reloaded config was not used immediately.
2016-12-27 22:46:57 -05:00
Joe Wilm ae470bf68b Implement copying selection for macOS
Still need automatic loading into selection copy buffer for linux.
2016-12-26 22:56:19 -05:00
Joe Wilm d28a734473 Refactor bindings and fix binding tests
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-26 19:00:27 -05:00
Joe Wilm 358c9fa17d Major cleanup for event handling
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-26 18:39:30 -05:00
Joe Wilm 3b7c7377c9 Refactor input processing to take action context
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-25 18:54:01 -05:00
Joe Wilm 7cdf06e2be Implement copypasta::Store for macOS pasteboard
Only works with strings, currently.
2016-12-24 18:08:46 -05:00
Joe Wilm 6e708d2119 Implement visual component of mouse selections
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-22 13:44:13 -05:00
Joe Wilm fd11660c0a Fix config reloading
The main refactor broke config reloading; specifically, colors were not
updating for subsequent draws.
2016-12-16 23:12:44 -08:00
Joe Wilm f32199ae69 Remove dead code 2016-12-16 22:52:38 -08:00
Joe Wilm bde4dacc79 Misc formatting fixes 2016-12-16 22:48:04 -08:00
Joe Wilm 781572096e Remove outdated and no longer correct doc 2016-12-16 22:30:27 -08:00
Joe Wilm 0421012c2d Replace remaining use of try! with ? 2016-12-16 22:29:35 -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 3b995ff87a Merge pull request #27 from quininer/ref_fish_cc
add fish_cc ref
2016-12-16 13:25:01 -08:00
quininer kel 0a53d3cb86 add fish_cc ref
and update Cargo.lock
2016-12-16 18:39:51 +08:00
Joe Wilm 0b3d2dac44 Handle overflow in Term::move_backward
Resolves #25
2016-12-15 09:13:34 -08:00
Joe Wilm 1a1b740c38 Remove need for Rc<RefCell<_>> usage
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-12 09:31:48 -08:00
Joe Wilm 4e9a307bed Fix a couple of compiler warnings 2016-12-12 09:31:29 -08:00