dankamongmen / notcurses

blingful character graphics/TUI library. definitely not curses.
https://nick-black.com/dankwiki/index.php/Notcurses
Other
3.57k stars 112 forks source link

bad escape sequence emitted by ncls #2711

Open PerBothner opened 1 year ago

PerBothner commented 1 year ago

I added logging to print the last 20 bytes and the next 20 bytes after the end of a Sixel sequence.

after handleSixel "6?A@??A!13?A!711?-\e\\" / "\e[32;1H             "
terminal.js:1283 after handleSixel "6?A@??A!13?A!711?-\e\\" / "\e[33;1H\e[2S\e[32;1H \e"
terminal.js:1283 after handleSixel "6?A@??A!13?A!711?-\e\\" / "\e[33;1H\r\n\e[31;1H/hom"
terminal.js:1283 after handleSixel "6?A@??A!13?A!711?-\e\\" / "\e[33;1H\r\n"
terminal.js:1283 after handleSixel "9??!3B?@!4?A!735?-\e\\" / "\e[-31;1H\eP0;1;0q\"1;1"
terminal.js:1283 after handleSixel "6?A@??A!13?A!711?-\e\\" / "\e[32;1H             "
terminal.js:1283 after handleSixel "9??!3B?@!4?A!735?-\e\\" / "\e[33;1H\e[31S\e[32;1H "
terminal.js:1283 after handleSixel "9??!3B?@!4?A!735?-\e\\" / "\e[33;1H\r\n\e[31;1H/hom"
terminal.js:1283 after handleSixel "9??!3B?@!4?A!735?-\e\\" / "\e[33;1H\r\n\e[1;1H\eP0;1"
terminal.js:1283 after handleSixel "44?$#252!5?A!741?-\e\\" / "\e[-31;1H\eP0;1;0q\"1;1"
terminal.js:1283 after handleSixel "9??!3B?@!4?A!735?-\e\\" / "\e[32;1H             "
terminal.js:1283 after handleSixel "44?$#252!5?A!741?-\e\\" / "\e[33;1H\e[31S"
terminal.js:1283 after handleSixel "44?$#252!5?A!741?-\e\\" / "\e[33;1H\r\n\e[31;1H/hom"
terminal.js:1283 after handleSixel "44?$#252!5?A!741?-\e\\" / "\e[33;1H\r\n"
terminal.js:1283 after handleSixel "?$#234!144?B!602?-\e\\" / "\e[-31;1H\eP0;1;0q\"1;1"
terminal.js:1283 after handleSixel "44?$#252!5?A!741?-\e\\" / "\e[32;1H             "
terminal.js:1283 after handleSixel "?$#234!144?B!602?-\e\\" / "\e[33;1H\e[31S\e[32;1H "
terminal.js:1283 after handleSixel "?$#234!144?B!602?-\e\\" / "\e[33;1H\r\n\e[39;49m\e[m"

Notice the negative row index for 3 of the CUP commands. Xterm handles this invalid sequence more gracefully, ignoring characters up through the H.

It is possible this is a domterm bug, with some bytes being inserted or otherwise garbled. But the pattern suggeste otherwise. The number of rows in this case is 32, so -31 looks suspicious. As does the 33 values, for that matter.

Environment:

export | egrep 'LANG|LC_CTYPE|TERM'
declare -x COLORTERM="truecolor"
declare -x DOMTERM="version=3.1.0;libwebsockets=4.3.2-no_hash;tty=/dev/pts/2;sessio
n#=1;pid=3112122"
declare -x GDM_LANG="en_US.UTF-8"
declare -x GNOME_TERMINAL_SCREEN="/org/gnome/Terminal/screen/1b511f0c_b9bd_4538_99e
4_a1d2761d4b5c"
declare -x GNOME_TERMINAL_SERVICE=":1.162"
declare -x LANG="en_US.UTF-8"
declare -x TERM="xterm-domterm"
declare -x TERMINFO="/home/bothner/tmp/DomTerm/share/terminfo"

This is ncls and DomTerm built from git pull today.

dankamongmen commented 1 year ago

sacre bleu!

dankamongmen commented 1 year ago

i'm doing dayjob stuff right now, but intend to look at this asap