summaryrefslogtreecommitdiff
path: root/src/ansi.rs
AgeCommit message (Collapse)Author
2017-05-01Support insert modeJoe Wilm
2017-04-19Partially add DECCOLM supportJoe Wilm
It's not possible with DECCOLM to temporarily set 80 or 132 column mode since the function is a toggle between the two. Instead, only the additional affects are run in order to get closer to passing vttest. vttest will never be perfect due to the column mode issue.
2017-04-18Fixes for vttest cursor movement screen 1Joe Wilm
2017-04-18Implement LF/NLJoe Wilm
2017-03-04Handle CSI command J3 (Clear saved lines)Aaron Hill
Xterm supports an extension to the CSI command `Erase in Display (ED)`, under the command number 3. This command is used to clear the scrollback buffer - e.g. anything not visible on the screen. Since scrollback is not part of alacritty, the handler for this command currently does nothing. If at some point scrollback is implemented, the corresponding `match` arm can be modified to properly handle this. For an example of a program which uses this command, run the `clear` command (using ncurses 6.0). In a supported terminal such as `gnome-terminal`, this will clear anything off of the screen from the scrollback buffer. Before this change, `alacritty` would generate an `Unhandled CSI` message.
2017-03-03Handle OSC command '1' (Set Icon Name)Aaron Hill
2017-02-25Change cursor colors config to use text and cursorJoe Wilm
This changes the cursor color config to use the `text` and `cursor` properties instead of the current `foreground` and `background` properties. The latter names stop making sense when dealing with cursors like a vertical bar or underscore. In the new system, the block, underscore, or vertical bar would always take the color of `cursor`, and the text would take the color of `text` when using a block, or keep its normal color when using the underscore or vertical bar. A warning is now emitted on startup when the old form of cursor color config is used. This will be a hard error in the future.
2017-02-11Handle OSC for setting indexed color valuesJoe Wilm
Resolves #26.
2017-02-02Implement save/restore cursor positionJoe Wilm
This passes the vttest for save and restore cursor position. The implementation was done according to: http://www.vt100.net/docs/vt510-rm/DECSC.html As of yet, there are a few things not supported by the terminal which should otherwise be saved/restored. vte was updated for a fix with CSI param parsing
2017-01-29support for inverting the cursor or using colorsDanny Dulai
2017-01-23Use the log-crate instead of printing to stdoutLukas Lueg
2017-01-21ansi: Designate and invoke graphic character setsRichard Palethorpe
Implement the designation of graphic character sets G0-G3 to ASCII or the Special character and line drawing glyphs. As well as the invokation/selection of the character sets (shift in, shift out and lock shifting).
2017-01-11Proposal for line wrap - ^[[7h and ^[[7l (private)Michael Brumlow
These changes provide support for disabling auto line wrap which is currently default to on. 'tput rman' will now disable auto line wrap and alacritty will now not automatically wrap lines. 'tput sman' will now (re)enable auto line wrap and alacritty will now automatically wrap lines once it reaches the end of the line. My testing showed this to work the same as gnome-terminal. I should note that simply having ^[[7h or ^[[7l in a recording does not enable and disable line wrapping. This is the same behavior as gnome-terminal and xterm. Those cape codes come through as private which are not handled yet. I behave this is the correct behavior.
2017-01-11Add support for setting title from OSCJoe Wilm
Resolves #23 Resolves #144
2017-01-08Fix parsing of coalesced SGR attributesJoe Wilm
cc #116
2017-01-06Remove need for inclusive rangesManish Goregaokar
2017-01-06Remove need for range_contains featureManish Goregaokar
2017-01-01Add support for SGR mouse reportingJoe Wilm
According to: http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
2016-12-16Misc formatting fixesJoe Wilm
2016-12-16Remove outdated and no longer correct docJoe Wilm
2016-12-16Rustup and clippyJoe Wilm
All of the changes in this commit are due to clippy lints.
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-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-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.
2016-12-11Add support for indexed colorsJoe Wilm
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.
2016-12-11Add support for bracketed pasteJoe Wilm
Binding/Action execute now has access to TermMode to support bracketed paste mode.
2016-12-11Support normal mouse tracking modeJoe Wilm
This allows the user for eg clicking columnts in htop to sort.
2016-11-19Add support for recording/running ref testsJoe Wilm
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`.
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.