summaryrefslogtreecommitdiff
path: root/src/ansi.rs
AgeCommit message (Collapse)Author
2016-10-28Support drawing bold test with bright colorsJoe Wilm
This feature is on by default
2016-10-23Proof of concept live reloading for colorsJoe Wilm
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.
2016-10-10Implement blank character insertionJoe Wilm
This is used by things like Bash's reverse-i-search and things get *very* messed up without it.
2016-09-23Fix some compiler warningsJoe Wilm
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.
2016-09-23Add unhandled `execute` logJoe Wilm
2016-09-23Fix missing `esc_dispatch` logJoe Wilm
This was previously logging as an unhandled `execute`.
2016-09-18Rewrite ansi parser using vte crateJoe Wilm
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.
2016-08-19Add Origin mode to parserJoe Wilm
2016-08-14Fix testsJoe Wilm
Errors/warnings fixed.
2016-07-29Fix debug printing in ansiJoe Wilm
It was always printing intead of only debug builds.
2016-07-29Fix tests in ansiJoe Wilm
Switched to vendored Utf8Chars.
2016-07-23Fix bug getting stuck in non-CSI escapesJoe Wilm
Escapes terminated by a bell were not properly handled.
2016-07-15Update to latest nightlyJoe Wilm
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.
2016-07-04Add some printing for unhandled non-CSI escapesJoe Wilm
2016-07-04Add support for application keypad modeJoe Wilm
Nothing uses it yet, but it is tracked in the terminal state.
2016-07-04Fix transpose bug with ansi gotoJoe Wilm
The line/column were swapped. Strong types are great, but we still have to be careful at the lowest level before they take effect!
2016-07-03Make ansi::Handler methods strongly typedJoe Wilm
ansi::Handler methods dealing with lines or columns now accept a `Line` or `Column` where appropriate instead of ambiguous `i64`.
2016-07-03Remove ansi::DebugHandlerJoe Wilm
DebugHandler was a helper during initial development of the parser. It's not used any longer.
2016-07-03Make ansi::TermInfo strongly typedJoe Wilm
The rows function has been renamed to lines, and it now returns `Line`. The cols function correspondingly returns `Column`.
2016-06-30Add config fileJoe Wilm
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.
2016-06-29Add license headers to source filesJoe Wilm
2016-06-23Fix bug handling ansi mode sequencesJoe Wilm
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.
2016-06-14Fix a few compiler warningsJoe Wilm
2016-06-09Fix backspaceJoe Wilm
There's never a count associated with this, and it has been removed from the Handler method to reflect as much.
2016-06-09Fix all trivial compiler warningsJoe Wilm
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.
2016-06-08Add support for scrolling regionsJoe Wilm
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.
2016-06-07Parse a few more ansi terminal mode commandsJoe Wilm
2016-06-06Fix escape bytes as input bug in ANSI parserJoe Wilm
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.
2016-06-06Minor updates to terminal handlingJoe Wilm
Properly handles goto_col and goto_row. Additionally, input wrapping is handled. Truecolor specs are now set appropriately.
2016-06-02Initial support for Terminal Emulation (woo!)Joe Wilm
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).
2016-05-28Initial ANSI parser implementationJoe Wilm
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.