DCS parameters not reset at unhook
dnkl opened this issue · 7 comments
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).
Or my favorite: "hello" should be bold but is instead colored red:
echo -e '\eP3X\e\\\e[1mhello\e[m'
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.
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.
@dnkl Can you reproduce this on the latest master? Because I cannot. Seems to work fine there.
Nvm.
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. 🤷♂️ This is confusing...
Fixed in #47.
Thanks!