alacritty / vte

Parser for virtual terminal emulators
https://docs.rs/vte/
Apache License 2.0
242 stars 56 forks source link

Interpret a trailing semicolon as an implicit '0' parameter #23

Closed VojtechStep closed 5 years ago

VojtechStep commented 5 years ago

From what I can find, escape sequence parameters are "optional numeric values separated by semicolons".

As the values are separated by semicolons, it makes sense that if a sequence ends with a semicolon, the terminal should expect another parameter. Because the parameter is an optional number, it should default to 0.

For example, the code \e[4;m should have the same effect as \e[4;0m, that is, none at all.

I tested this specific sequence in kitty, termite, xterm, st and alacritty, and only alacritty draws the following text underlined.

It should be a simple fix and I will include it in my PR for #22

chrisduerr commented 5 years ago

I can also confirm that rxvt-unicode behaves the same way. So it seems like we should follow this example and interpret it as 0.