wttr.in icon indicating copy to clipboard operation
wttr.in copied to clipboard

Option &T doesn't remove some Esc sequences

Open nick87720z opened this issue 4 years ago • 1 comments

There's strange escape sequence: <1b>)B, not removed by &T option (whose description states removing all terminal sequences, not just colors. This sequence seems to be part of v2 format, as I don't see it in default format. Ccan't understand it's meaning, as it looks same with it and without in terminals I have in use (tried xfce4 term, urxvt, alacritty).

Command: curl 'https://wttr.in/Prague?format=v2&T&F&lang=en' wttr in - escfix - before-fs8-zopfli

For now I workarounded this by filtering with sed: curl -s 'https://wttr.in/Prague?format=v2&T&F&lang=en' | sed 's/\x1b(B//g'

Or more extended - if tooltip has borders, this could also have borders filtered: curl -s 'https://wttr.in?format=v2&T&F&lang=ru' | sed '/[└┘]/d; {s/^[┌│]//; s/[│┐]$//; s/\x1b(B//g}' wttr in - tint2exec-fs8-zopfli

Perhaps, better not use color emoji outside of terminal, as their size doesn't match any monospace font - it seems even pango can't determine correct width, at least first time.

nick87720z avatar Sep 02 '21 12:09 nick87720z

Yes, we have a similar problem for the one-line mode, and there we have an option to disable the emojis. Maybe we should add something like this here. And yes, I can confirm the problem with excessive ANSI symbols when T. We have the same problem in rate.sx, where the same rendering engine is used. I am working on a new rendering engine now, that will don't have this problem

chubin avatar Oct 16 '21 11:10 chubin