aboutsummaryrefslogtreecommitdiff
path: root/src/ansi.rs
AgeCommit message (Collapse)Author
2017-12-03Add cursor style option (#928)Christian Duerr
The default cursor can now be configured through the cursor_style field of the config. Valid options include Block, Underline, and Beam. The default can be restored by sending \e[0q as in VTE terminals. Live config reloading is supported for this parameter.
2017-11-11Support more color escape codes (#757)Tuomas Siipola
* Support text cursor color escape codes * Support reset color index escape code * Support multiple colors in set color index escape code
2017-10-30fix some typos in commentsMartin Lindhe
2017-09-30implement ANSI CSI REP (Repeat)Jasper Bryant-Greene
2017-09-27Use clippy = "*", update, and fix some warnings (#796)Aaron Hill
Because there are so many clippy warnings in the current codebase, this commit removes '#![cfg_attr(feature = "clippy", deny(clippy))]', to make it easier to fix warnings incrementally.
2017-07-28Support background and foreground color escape codes (#662)Tuomas Siipola
2017-07-20Implement and use ansi attribute CancelBold (#659)ftilde
2017-06-23Add dim color supportJake Merdich
Add support for the VTE 'dim' flag, with additional support for custom-themed dim colors. If no color is specified in the config, it will default to 2/3 the previous (not a spec, but the value other terminals seem to use). The actual dimming behavior brings bright colors to normal and regular colors to the new dim ones. Custom RGB values are not changed, nor are non-named indexed colors.
2017-06-11Add support for Beam, Underline cursorsJoe Wilm
Notable about this implementation is it takes a different approach for managing cursor cells that previously. The terminal Grid is now borrowed *immutably*. Instead of mutating Cells in the Grid, a list is managed within the RenderableCellsIter. The cell at the cursor location is skipped over, and instead cells are popped off a list of cursor cells. It would be good in the future to share some more code between the different cursor style implementations for populating the cursor cells list. Supercedes #349.
2017-05-29Implement FocusIn/FocusOut reports (#589)Aaron Hill
Implements sending FocusIn/FocusOut events, as defined at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-FocusIn_FocusOut
2017-05-08Fix Device Status reportsDominik Miedziński
2017-05-07Add support for Query Device StatusDominik Miedziński
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.