aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
Commit message (Collapse)AuthorAge
...
* Add support for SGR mouse reportingJoe Wilm2017-01-01
| | | | | According to: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
* Misc formatting fixesJoe Wilm2016-12-16
|
* Remove outdated and no longer correct docJoe Wilm2016-12-16
|
* Rustup and clippyJoe Wilm2016-12-16
| | | | All of the changes in this commit are due to clippy lints.
* Cleaning up main; Added window moduleJoe Wilm2016-12-11
| | | | | | | | 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().
* Implement Handler::identify_terminal for TermJoe Wilm2016-12-11
| | | | | The identify_terminal function signature had to change to support writing to the terminal before processing additional input.
* Refactor color list managementJoe Wilm2016-12-11
| | | | | | | | 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.
* Add support for indexed colorsJoe Wilm2016-12-11
| | | | | | | | ANSI escape sequences like `\x1b[48;5;10m` were not supported until now. Specifically, the second attribute, 5, says that the following attribute is a color index. The ref tests were updated since `enum Color` variants changed.
* Add support for bracketed pasteJoe Wilm2016-12-11
| | | | | Binding/Action execute now has access to TermMode to support bracketed paste mode.
* Support normal mouse tracking modeJoe Wilm2016-12-11
| | | | This allows the user for eg clicking columnts in htop to sort.
* Add support for recording/running ref testsJoe Wilm2016-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* Support drawing bold test with bright colorsJoe Wilm2016-10-28
| | | | This feature is on by default
* Proof of concept live reloading for colorsJoe Wilm2016-10-23
| | | | | | | The architecture here is really poor. Need to move file watching into a dedicated location and probably have an spmc broadcast queue. other modules besides rendering will care about config reloading in the future.
* Implement blank character insertionJoe Wilm2016-10-10
| | | | | This is used by things like Bash's reverse-i-search and things get *very* messed up without it.
* Fix some compiler warningsJoe Wilm2016-09-23
| | | | | | | | | 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.
* Add unhandled `execute` logJoe Wilm2016-09-23
|
* Fix missing `esc_dispatch` logJoe Wilm2016-09-23
| | | | This was previously logging as an unhandled `execute`.
* Rewrite ansi parser using vte crateJoe Wilm2016-09-18
| | | | | | | 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.
* Add Origin mode to parserJoe Wilm2016-08-19
|
* Fix testsJoe Wilm2016-08-14
| | | | Errors/warnings fixed.
* Fix debug printing in ansiJoe Wilm2016-07-29
| | | | It was always printing intead of only debug builds.
* Fix tests in ansiJoe Wilm2016-07-29
| | | | Switched to vendored Utf8Chars.
* Fix bug getting stuck in non-CSI escapesJoe Wilm2016-07-23
| | | | Escapes terminated by a bell were not properly handled.
* Update to latest nightlyJoe Wilm2016-07-15
| | | | | | | 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.
* Add some printing for unhandled non-CSI escapesJoe Wilm2016-07-04
|
* Add support for application keypad modeJoe Wilm2016-07-04
| | | | Nothing uses it yet, but it is tracked in the terminal state.
* Fix transpose bug with ansi gotoJoe Wilm2016-07-04
| | | | | The line/column were swapped. Strong types are great, but we still have to be careful at the lowest level before they take effect!
* Make ansi::Handler methods strongly typedJoe Wilm2016-07-03
| | | | | ansi::Handler methods dealing with lines or columns now accept a `Line` or `Column` where appropriate instead of ambiguous `i64`.
* Remove ansi::DebugHandlerJoe Wilm2016-07-03
| | | | | DebugHandler was a helper during initial development of the parser. It's not used any longer.
* Make ansi::TermInfo strongly typedJoe Wilm2016-07-03
| | | | | The rows function has been renamed to lines, and it now returns `Line`. The cols function correspondingly returns `Column`.
* Add config fileJoe Wilm2016-06-30
| | | | | | | | | 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.
* Add license headers to source filesJoe Wilm2016-06-29
|
* Fix bug handling ansi mode sequencesJoe Wilm2016-06-23
| | | | | | | The sense of set_mode and unset_mode was inverted. The TextCursor/ShowCursor mode depended on the incorrect behavior, and that was fixed as well. TextCursor was renamed to ShowCursor to be perfectly clear on the intent.
* Fix a few compiler warningsJoe Wilm2016-06-14
|
* Fix backspaceJoe Wilm2016-06-09
| | | | | There's never a count associated with this, and it has been removed from the Handler method to reflect as much.
* Fix all trivial compiler warningsJoe Wilm2016-06-09
| | | | | | | | | | | 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.
* Add support for scrolling regionsJoe Wilm2016-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It's now possible to move around within Vim without the screen becoming corrupt! The ANSI parser now calls a (new) `set_scrolling_region` on the handler when the DECSTBM CSI is received. In order to provide a sensible default in case that the sequence doesn't include arguments, a TermInfo trait was added which currently has methods for inspecting number of rows and columns. This was added as an additional trait instead of being included on Handler since they have semantically different purposes. The tests had to be updated to account for the additional trait bounds. The utilities module now has a `Rotate` trait which is implemented for the built-in slice type. This means that slices and anything derefing to a slice can be rotated. Since VecDeque doesn't support slicing (it's a circular buffer), the grid rows are now held in a Vec to support rotation. For ergomomic access to the grid for scrolling and clearing regions, additional Index/IndexMut implementations were added to the grid::Row type. Finally, a `reset` method was added to `Cell` which properly resets the state to default (instead of just clearing the char). This supports region clearing and also fixed a bug where cell backgrounds would remain after being cleared.
* Parse a few more ansi terminal mode commandsJoe Wilm2016-06-07
|
* Fix escape bytes as input bug in ANSI parserJoe Wilm2016-06-06
| | | | | | | There were several unrecognized escape codes that have arguments which were being interpretted as input. Naturally, this caused state to be corrupt. The escape codes are now handled by throwing away the bytes. Consider this a TODO for later.
* Minor updates to terminal handlingJoe Wilm2016-06-06
| | | | | | | Properly handles goto_col and goto_row. Additionally, input wrapping is handled. Truecolor specs are now set appropriately.
* Initial support for Terminal Emulation (woo!)Joe Wilm2016-06-02
| | | | | | | | | | | | | | | | This patch introduces basic support for terminal emulation. Basic means commands that don't use paging and are not full screen applications like vim or tmux. Some paging applications are working properly, such as as `git log`. Other pagers work reasonably well as long as the help menu is not accessed. There is now a central Rgb color type which is shared by the renderer, terminal emulation, and the pty parser. The parser no longer owns a Handler. Instead, a mutable reference to a Handler is provided whenever advancing the parser. This resolved some potential ownership issues (eg parser owning the `Term` type would've been unworkable).
* Initial ANSI parser implementationJoe Wilm2016-05-28
This is the initial terminal stream parsing implementation for Alacritty. There are currently several TODOs, FIXMEs, and unimplemented! things scattered about still, but what's here is good enough to correctly parse my zsh startup. The `Parser` implementation is largely based on the suck-less _simple terminal_ parser. Because this is Rust and Rust has a fantastic type system, some improvements are possible. First, `Parser` is a struct, and its data is stored internally instead of statically. Second, there's no terminal updates hard-coded into the parser. Instead, `Parser` is generic over a `Handler` type which has methods for all of the actions supported by the parser. Because Parser is generic, it should be possible (with proper inlining) to have equivalent performance to the hard-coded version. In addition to using _simple terminal_ as a reference, there's a doc in Alacritty's repository `docs/ansicode.txt`, a summary of the ANSI terminal protocol, which has been referenced extensively. There's probably a large number escapes we don't handle, and that's ok. There's a lot that aren't necessary for everyday terminal usage. If you feel like something that's not supported should be, feel free to add it. Please try not to become overzealous and adding support for sequences only used by folks trapped in 1988.