Age | Commit message (Collapse) | Author |
|
Fix tests and add line select
Refactor BidirectionalIter to remove if blocks
Allow for cells tagged with WRAPLINE to continue expanding the selection
Reorganize config into structs
Add test coverage that callbacks are called
Cleanup mouse config
- Uses Duration type for ClickHandler::threshold
- Removes `action` property from ClickHandler--this can be added in a
backwards compatible way later on
- Renames ClickState::DblClick to DoubleClick
fixup! Cleanup mouse config
|
|
Fixes #48
|
|
Adds a new "Quit" action and binds it to Cmd-W and Cmd-Q on Mac OS in an
attempt to make Alacritty feel more like a "normal" citizen of the
operating system. Alternatives like Ctrl-D are okay, but I usually want
to leave my shells nested within Tmux open even if I exit my terminal.
It's also largely selfish: I've built up muscle memory over the years
that takes my fingers to Cmd-Q first (and I suspect I'm not the only
one).
The implementation for an exit is copied from `event.rs` which notably
is already tagged with a FIXME. It seems that `tty.rs` contains a
`process_should_exit` system to help handle a `SIGCHLD`, and it's
possible that these two exit implementations should be merged together.
I could probably tackle that as my next project.
As mentioned in #218, Alacritty can't really spawn other windows right
now, so I've tied in Cmd-W as simply another synonym for quitting until
that's implemented.
Fixes #218.
|
|
Should make input processing much more easily tested.
|
|
Paste & PasteSelection are not quite the same. The former should be
pulling from the main clipboard where the latter does not.
|
|
|
|
|
|
cc #87, #55
|
|
|
|
Resolves #46.
|
|
Resolves #43.
|
|
Resolves #37.
|
|
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.
|
|
According to:
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
|
|
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.
|
|
Moving the window on macOS would cause a panic in certain circumstances.
|
|
|
|
Still need automatic loading into selection copy buffer for linux.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
All of the changes in this commit are due to clippy lints.
|
|
|
|
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.
|
|
This makes scrolling work for mouse wheels (was previously just
trackpads).
|
|
Binding/Action execute now has access to TermMode to support bracketed
paste mode.
|
|
Linebased scrolling is still unsupported (need a mouse to test with).
|
|
This allows the user for eg clicking columnts in htop to sort.
|
|
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`.
|
|
Bindings were previously hardcoded within input.rs; adding, removing, or
changing a binding required a recompile! Now, bindings may be declared
in alacritty.yml. Even better, bindings are live-reloaded when
alacritty.yml is changed!
One unexpected benefit of this change was that all of the special casing
in input.rs has disappeared.
Conversely, config.rs has gained complexity for all of the
deserialization logic.
Resolves #3.
|
|
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.
|
|
Adds support for pageup, pagedown, home, and end. Fixes delete inserting
spaces.
Resolves #15.
|
|
|
|
Now uses serde_dervive \o/
|
|
Currently it only supports x11 via the xclip program, and that only
supports reading the clipboard contents.
|
|
This is a bit of an experiment to see if simply handling 'v' in the
bindings will work or has any bugs not going through ReceivedCharacter.
The change is necessary though to prevent 'v' from being written in
front of every clipboard paste.
|
|
doesn't work on ubuntu 16.04 for some reason
|
|
This type and its implementations were seriously cluttering main.rs.
|
|
|
|
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.
|
|
Errors/warnings fixed.
|
|
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.
|
|
Added a test while debugging arrow keys, no reason to delete it.
|
|
Don't need to handle modifier keys beyond updating state
|
|
Make sure all input bytes get flushed
|
|
Glutin sends both a received character and the key pressed event when a
key is pressed. Because delete and backspace are mapped in reverse by
terminal standards, we ignore the received character 0x07 and 0x7f
values. However, this breaks Control-H since this normally sends 0x07 as
well. The fix here adds handling for Control-H through the input
tracking system.
|
|
The default characters sent for this were incorrect. Delete now sends
xterm-compatible escapes (dch1, kdch1), and Backspace sends the delete
code 0x7f.
|
|
It's a generic impl of `input::Notify` for `Write` types; as such, it
seems completely reasonable to include in the input module. Moving it
also serves to declutter main.
|
|
|