aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Add SCP control supportMohammad AlSaleh2024-04-01
| | | | | | | | | | Modern usage of this control function comes from the BiDi draft proposal: https://terminal-wg.pages.freedesktop.org/bidi/recommendation/escape-sequences.html The draft slightly extends the definition in ECMA-48. Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
* Add support for DECRQM/DECRPMKirill Chibisov2023-11-17
| | | Fixes #100.
* Split-out `PrivateMode` from 'Mode'Kirill Chibisov2023-11-17
| | | | | | The modes could overlap and there's also no way to actually forward information about unhandled modes downstream, thus split the modes into 2 separate structures and pass unhandled modes.
* Reexport cursor_icon crateKirill Chibisov2023-11-15
|
* Ensure proper enum representationEthan Pailes2023-11-04
|
* Add support for xterm's modifyOtherKeys CSIKirill Chibisov2023-09-26
| | | | | | | | Given that an example of the translation table is not present by xterm and they provide only script to generate one from the running X11 system, the example of the output is also included in the repository now. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Switch sync escape from DCS to CSIChristian Duerr2023-09-19
| | | See alacritty/alacritty#6845.
* Add support for kitty keyboard protocolKirill Chibisov2023-08-10
| | | | | | This just adds handling of the CSI u escapes mentioned in the spec and don't provide key to escape sequence transformation for the terminals. Links: https://sw.kovidgoyal.net/kitty/keyboard-protocol
* Add support for OSC 22Kirill Chibisov2023-08-07
|
* Add const generic for no-std OSC buffer limitJonathan 'theJPster' Pallant2023-07-16
| | | | | | | | | | | The OSC buffer limit was set to 1024 bytes by default for no-std targets. Especially when operating in a restricted environment where OSC escapes are irrelevant, this consumes a lot of unnecessary memory. This patch adds a const generic that allows controlling the target size of the OSC buffer at compile-time, making it possible to remove the buffer entirely if OSCs are not required. Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Bump rust-version to match actual MSRVDirkjan Ochtman2023-05-26
|
* Add ansi color contrast tests forAnhad Singh2023-05-18
|
* Migrate `ansi` from `alacritty_terminal`Anhad Singh2023-05-14
| | | | | | Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com> Signed-off-by: Anhad Singh <andypythonappdeveloper@gmail.com> Co-authored-by: Nicholas Sim <nsim@posteo.net> Co-authored-by: Christian Duerr <contact@christianduerr.com>
* Bump arrayvec to 0.7.2Nikhil Benesch2022-07-18
|
* Fix filled params list ending with subparamChristian Duerr2022-05-17
| | | | | | | | | | | | When the params list for the CSI/DCS escapes is filled with all 32 parameters but ends in a subparameter, it would not properly stage the length of the added subparameters causing the param iterator to get stuck in place. To ensure we always update the subparameter length even when no parameter is staged after it, the length of subparameters is now updated immediately while the subparameters itself are added. Fixes #77.
* Migrate to 2021 editionKirill Chibisov2022-01-16
|
* Refactor test codeChristian Duerr2021-02-21
| | | | | | | | This changes the test code to use only a single dispatcher instead of having a dispatcher for every single type of escape sequence. This makes it trivial to test transitions between the two separate escape sequence types.
* Fix intermediate reset when going from DCS to ESCChristian Duerr2021-02-21
| | | | | | This resolves a bug when transitioning between DCS and ESC sequences, which would cause the intermediates of the ESC dispatch to contain data from the DCS sequence.
* Make all methods of the trait `Perform` optionalChristian Duerr2020-11-27
| | | | | | | | | | I've noticed while playing around with vte in a personal project, that I didn't need all of the methods of the `Perform` trait. In Alacritty we also don't react to everything and other crates like `strip-ansi-escapes` basically doesn't respond to anything. Of course it's always easy to just copy/paste the entire trait and move on, but I think it's probably worth making the life of downstream easier by not enforcing this.
* Reduce the maximum value of CSI parametersChristian Duerr2020-11-26
| | | | | | | | | | | | | | | | | | Since limits CSI parameters to be within range of `u16`, rather than `i64`. This should effectively prevent downstream users from running into DoS problems with excessively big escape sequence requests. An example of a problematic escape would be `CSI Ps b` (repeat char). According to https://vt100.net/emu/dec_ansi_parser, the smallest possible size limit would be `16383`: > The VT500 Programmer Information is inconsistent regarding the maximum > value that a parameter can take. In section 4.3.3.2 of EK-VT520-RM it > says that “any parameter greater than 9999 (decimal) is set to 9999 > (decimal)”. However, in the description of DECSR (Secure Reset), its > parameter is allowed to range from 0 to 16383. Because individual > control functions need to make sure that numeric parameters are within > specific limits, the supported maximum is not critical, but it must be > at least 16383.
* 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.
* Improve parser performanceChristian Duerr2020-07-27
|
* Remove C1 ST support from OSCsChristian Duerr2020-04-15
|
* Fix OOB in DCS parserChristian Duerr2020-03-02
| | | | | | | This resolves an issue with parsing of DCS escapes, where it would try to write parameters beyond the maximum parameter count limit. Fixes #50.
* Remove ESC paramsChristian Duerr2020-02-01
| | | | Since ESC escapes cannot have parameters, they have been removed from the `esc_dispatch` function.
* Fix param not resetting between escapesChristian Duerr2020-01-31
| | | | Fixes #46.
* 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.
* Discard CSI sequences with too many parametersVojtěch Štěpančík2019-12-28
| | | Fixes #24.
* Remove outdated table.rs.in fileChristian Duerr2019-12-16
|
* Rename generate_state_changes proc macroChristian Duerr2019-12-10
| | | | | This renames the generate_state_changes proc macro to include the `vte_` prefix, since it's not useful to anyone other than our `vte` crate.
* Remove table generationChristian Duerr2019-12-10
| | | | | | | | | | | | | | | This completely removes the `codegen` project, which relied on outdated libraries to parse DSLs to build the utf8 and vte state tables, to make the library easier to maintain. The utf8 table could be completely removed in favor of a `match` statement, which also lead to a performance improvement with the utf8 parser. The vte table did not benefit from `match` statements at all and instead had significantly worse performance with it. To replace the old codegeneration for vte, the `generate_state_changes` crate has been created instead, which uses the language's proc_macro feature to create a `const fn` which will generate the table at compile time.
* 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.
* Add dynamic buffer supportChristian Duerr2019-11-22
|
* Bump version to 0.4.0Christian Duerr2019-11-04
|
* fix dcs handling, and add a test for itJesse Luehrs2019-11-03
|
* Address stylistic issuesVojtechStep2019-08-06
|
* Simplify csi dispatchingVojtechStep2019-08-06
|
* Add an implicit zero after trailing semicolonVojtechStep2019-08-06
|
* Use correct md code fenceFelix Rabe2019-04-25
|
* Fix off-by-one error when parsing CSI escapesChristian Duerr2018-08-13
| | | | | | | | | | | | | | | | | The CSI escape sequences are limited to 16 parameters using the `MAX_PARAMS` constant. To make sure no more params are parsed, the CSI parser stops when the parameter index reaches `MAX_PARAMS`, however this means that it stops at index 16, which means that the number of params would be 17 since arrays start at 0. To fix this off-by-one error the CSI parser now stops when the index reaches `MAX_PARAMS - 1`, which means it will stop when the index reaches the last element in an array with `MAX_PARAMS` number of elements. This fixes jwilm/alacritty#1505.
* Fix links to ANSI parser state machine. http links result in a 404 now,Ted Mielczarek2018-01-12
| | | | but https links work.
* Fix tests to run.Nathan Lilienthal2018-01-10
| | | | Links against STD to allow use of Vec.
* no_std (#9)M Farkas-Dyck2017-11-18
|
* Properly handle maximum number of CSI paramsAaron Hill2017-05-29
| | | | | | | This commit ensures that 'num_params' is never incremented beyond MAX_PARAMS. Additionally, an extra parameter is added to the corresponding OSC test (17 params or MAX_PARAMS + 1) to ensure that the proper behavior is tested.
* Prevent overflow when parsing CSI/DCS parametersAaron Hill2017-05-19
| | | | | To prevent a large CSI or DCS parameter from overflowing an i64, the value is limited to i64::MAX
* Properly handle maximum number of OSC parametersAaron Hill2017-05-16
| | | | | | Previously, `osc_num_params` would be incremented when the final parameter finished parsing, even if it was already at `MAX_PARAMS`. This commit ensures that it is not incremented beyond `MAX_PARAMS`.
* Fix bug in OSC parsing and drop 8-bit code supportJoe Wilm2017-03-01
| | | | | OSC parsing now handles UTF-8 arguments. 8-bit code support was dropped to make supporting this easier.
* Fix bug parsing CSI attributesJoe Wilm2017-02-02
| | | | | | | | | The sequence \E[;4m previously produced a param list of [4], but the expected result is [0, 4]. The semicolon indicated that a param has been completed. Since no byte is specified, it should be zero. This fixes an issue with the save/restore cursor test in vttest for Alacritty.
* Fix bug with OSC parsingJoe Wilm2017-01-10
| | | | | An osc_dispatch with zero params would cause an underflow and index out of bounds of self.osc_params.
* Version 0.2Joe Wilm2017-01-10
| | | | | Changelog has details, but this basically made OSC handling way easier for dependents.