alacritty / vte

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

DCS parameters not reset at unhook #46

Closed dnkl closed 4 years ago

dnkl commented 4 years ago

alacritty 0.4.1

It seems parameter(s) are not reset at the end of an DCS. Some examples:

"hello" should be colored red, but isn't:

echo -e '\eP1X\e\\\e[31mhello\e[m'

"hello" should not be colored, but is:

echo -e '\eP31X\e\\\e[mhello\e[m'

"hello" should not be bold, but is:

echo -e '\eP1X\e\\\e[mhello\e[m'

All the above works in xterm and urxvt.

For a real-world example, see https://codeberg.org/dnkl/page, it uses the (not yet standardized) BSU/ESU DCS sequences and it is completely broken in Alacritty (do cat <large-file> | page and scroll).

dnkl commented 4 years ago

Or my favorite: "hello" should be bold but is instead colored red:

echo -e '\eP3X\e\\\e[1mhello\e[m'
kchibisov commented 4 years ago

Alacritty doesn't handle DCS right now. I don't have an answer for you why. Our parser does have all the thing we need and exposes API, but we just do literally nothing as far as I can see.

chrisduerr commented 4 years ago

It seems like for the first example, VTE dispatches with the parameter 131 instead of 31. Though it does look like it correctly tracks state changes.

chrisduerr commented 4 years ago

@dnkl Can you reproduce this on the latest master? Because I cannot. Seems to work fine there.

Nvm.

dnkl commented 4 years ago

It seems like for the first example, VTE dispatches with the parameter 131 instead of 31

~Sounds like VTE has a similar bug?~

~Using https://vt100.net/emu/dec_ansi_parser as reference, there are a number of states with the entry action clear; escape, CSI entry and DCS entry.~

~clear causes the current private flag, intermediate characters, final character and parameters to be forgotten~

Oooh, you meant alacritty/vte, not GNOME/vte. :man_shrugging: This is confusing...

chrisduerr commented 4 years ago

Fixed in https://github.com/alacritty/vte/pull/47.

dnkl commented 4 years ago

Thanks!