aboutsummaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAge
* Add CSI subparameter supportChristian Duerr2020-08-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for CSI subparameters like `\x1b[38:2:255:0:255m`, which allows the combination of truecolor SGR commands together with other SGR parameters like bold text, without any ambiguity. This implements subparameters by storing them in a list together with all other parameters and having a separate slice to indicate which parameter is a subparameter and how long the subparameter list is. This allows for static memory allocation and good performance while still having the option for dynamic sizing of the parameters. Since the subparameters are now also counted as parameters, the number of allowed parameters has been increased from `16` to `32`. Since the existing structures combine the handling of parameters for CSI and DCS escape sequences, it is now also possible for DCS parameters to have subparameters, even though that is currently never used. Considering that DCS is rarely supported by terminal emulators, handling these separately would likely just cause unnecessary issues. The performance should also be better by using this existing subparam structure rather than having two separate structures for DCS and CSI parameters. The only API provided for accessing the list of parameters is using an iterator, this is intentional to make the internal structure clear and allow for easy optimizations downstream. Since it makes little sense to access parameters out of order, this limitation should not have any negative effects on performance. The main drawback is that direct access to the first parameter while ignoring all other subparameters is less efficient, since it requires indexing a slice after iterating to the element. However while this is often useful, it's mostly done for the first few parameters which significantly reduces the overhead to a negligible amount. At the same time this forces people to support subparameters or at least consider their existence, which should make it more difficult to implement things improperly downstream. Fixes #22.
* Rename example variable to match traitDan Gohman2020-06-15
|
* Remove ESC paramsChristian Duerr2020-02-01
| | | | Since ESC escapes cannot have parameters, they have been removed from the `esc_dispatch` function.
* Pass terminator to osc dispatcherChristian Duerr2020-01-29
| | | | | | | | | | | | | | Even though the ST terminator is the only officially supported terminator, some applications still rely on BEL to work properly. Both have been supported historically, however there was no way for the terminal to tell which terminator was used. Since OSC escapes frequently offer the `?` parameter to query for the current format, some applications expect the response terminator to match the request terminator. To make it possible to support this, the osc_dispatcher is now informed when the BEL terminator was used. Since the C1 ST terminator was not yet supported for OSC escapes, support for it has also been added.
* Update to Rust 2018Christian Duerr2019-11-23
| | | | | | This moves all crates in the workspace to the latest Rust standard and resolves various style and formatting issues. Fixes #32.
* Bump version to 0.4.0Christian Duerr2019-11-04
|
* fix dcs handling, and add a test for itJesse Luehrs2019-11-03
|
* Fix typo in parselog examplePeter Holloway2018-03-09
| | | | osc_dispatch calls were being logged as csi_dispatch
* Version 0.2Joe Wilm2017-01-10
| | | | | Changelog has details, but this basically made OSC handling way easier for dependents.
* Fix import in exampleJoe Wilm2016-09-17
|
* Rename and document vte crateJoe Wilm2016-09-17
|
* Add support for UTF-8Joe Wilm2016-09-17
| | | | | | | | | | | This adds a table-driven UTF-8 parser which only has a single branch for the entire parser. UTF-8 support is essentially bolted onto the VTE parser. Not the most elegant, but it does prevent the transition tables from blowing up. Instead of refactoring the syntax extension to handle both table definitions, I've opted to copy/paste now for both simplicities sake and because I can't see a clear path to a minimal shared solution.
* Implement first version of parserJoe Wilm2016-09-16
Includes an example `parselog` which prints all of the actions a Parser implementation is given the opportunity to handle. One way to test this is to pipe vim into it: vim | target/release/examples/parselog And type `:q` to quit. Vim won't show up, but it still accepts input. This version of the parser doesn't handle UTF-8. It's implemented as described by http://vt100.net/emu/dec_ansi_parser which did not include UTF-8 support. Next steps are adding UTF-8 support.