Re: ANSI test scripts to test terminal capabilities?

Dennis Williamson <[email protected]> Tue, 29 Aug 2023 20:25:38 -0500
Newsgroups gmane.comp.gnu.screen.user
Message-ID <CANaoh6JHcrfjrZOQ+Jv=o564+jYGp43MJJBb9X9vhNe7mNDTrg@mail.gmail.com>
--000000000000c8d843060419cec6
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Tue, Aug 29, 2023 at 7:25=E2=80=AFPM Dan Mahoney (Gushi) <[email protected]=
hi.org>
wrote:

> Hey there all,
>
> This might be slightly off-topic.  I am using a tool called wp-cli, where
> it tries to set "bold" values in its help text thusly:
>
> ESC[1mNAMEESC[0m
>
>    wp
>
> ESC[1mDESCRIPTIONESC[0m
>
>    Manage WordPress through the command-line.
>
> ESC[1mSYNOPSISESC[0m
>
>    wp <command>
>
> ESC[1mSUBCOMMANDSESC[0m
>
> So obviously, when I see those escape codes, my first thought was "I'm
> running screen, it's not recognizing them".  But that's not it.
>
> The problem happens even outside of screen, where terminal color still
> works perfectly well.  It breaks with both iterm and the mac terminal app=
.
> It breaks over both mosh and ssh.
>
> Ergo, either this is some kind of a terminal issue (I've tried xterm and
> xterm-256color), or a bug with the script where what it thinks is an
> escape code actually isn't sending the right escapes.
>
> Before I report this as a bug to them, I'd like to see if I can find some
> kind of "rosetta stone" that outputs various things that a terminal shoul=
d
> support.  Ascii, Colors, 256-colors, ANSI escape codes, line draw
> characters, emojii, etc.
>
> I've found https://gist.github.com/sdeaton2/8450564 but I'm looking for
> something more complete.
>
> Does anyone know of such a thing?
>
> -Dan
>
> --
>
> -Harry nods-
>
> Vincent Spano, as Boris in "Creator".
>
>
> --------Dan Mahoney--------
> Techie,  Sysadmin,  WebGeek
> Gushi on efnet/undernet IRC
> FB:  fb.com/DanielMahoneyIV
> LI:   linkedin.com/in/gushi
> Site:  http://www.gushi.org
> ---------------------------
>
>
>
A) Use tput or an ANSI library to obtain the code sequences based on the
TERM setting instead of hard coding them.

B) See vttest https://invisible-island.net/vttest/vttest.html for xterm
tests

--=20
Visit serverfault.com to get your system administration questions answered.

--000000000000c8d843060419cec6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Tue, Aug 29, 2023 at 7:25=E2=80=AF=
PM Dan Mahoney (Gushi) &lt;<a href=3D"mailto:[email protected]">danm@pri=
me.gushi.org</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex">Hey there all,<br>
<br>
This might be slightly off-topic.=C2=A0 I am using a tool called wp-cli, wh=
ere <br>
it tries to set &quot;bold&quot; values in its help text thusly:<br>
<br>
ESC[1mNAMEESC[0m<br>
<br>
=C2=A0 =C2=A0wp<br>
<br>
ESC[1mDESCRIPTIONESC[0m<br>
<br>
=C2=A0 =C2=A0Manage WordPress through the command-line.<br>
<br>
ESC[1mSYNOPSISESC[0m<br>
<br>
=C2=A0 =C2=A0wp &lt;command&gt;<br>
<br>
ESC[1mSUBCOMMANDSESC[0m<br>
<br>
So obviously, when I see those escape codes, my first thought was &quot;I&#=
39;m <br>
running screen, it&#39;s not recognizing them&quot;.=C2=A0 But that&#39;s n=
ot it.<br>
<br>
The problem happens even outside of screen, where terminal color still <br>
works perfectly well.=C2=A0 It breaks with both iterm and the mac terminal =
app. <br>
It breaks over both mosh and ssh.<br>
<br>
Ergo, either this is some kind of a terminal issue (I&#39;ve tried xterm an=
d <br>
xterm-256color), or a bug with the script where what it thinks is an <br>
escape code actually isn&#39;t sending the right escapes.<br>
<br>
Before I report this as a bug to them, I&#39;d like to see if I can find so=
me <br>
kind of &quot;rosetta stone&quot; that outputs various things that a termin=
al should <br>
support.=C2=A0 Ascii, Colors, 256-colors, ANSI escape codes, line draw <br>
characters, emojii, etc.<br>
<br>
I&#39;ve found <a href=3D"https://gist.github.com/sdeaton2/8450564" rel=3D"=
noreferrer" target=3D"_blank">https://gist.github.com/sdeaton2/8450564</a> =
but I&#39;m looking for <br>
something more complete.<br>
<br>
Does anyone know of such a thing?<br>
<br>
-Dan<br>
<br>
-- <br>
<br>
-Harry nods-<br>
<br>
Vincent Spano, as Boris in &quot;Creator&quot;.<br>
<br>
<br>
--------Dan Mahoney--------<br>
Techie,=C2=A0 Sysadmin,=C2=A0 WebGeek<br>
Gushi on efnet/undernet IRC<br>
FB:=C2=A0 <a href=3D"http://fb.com/DanielMahoneyIV" rel=3D"noreferrer" targ=
et=3D"_blank">fb.com/DanielMahoneyIV</a><br>
LI:=C2=A0 =C2=A0<a href=3D"http://linkedin.com/in/gushi" rel=3D"noreferrer"=
 target=3D"_blank">linkedin.com/in/gushi</a><br>
Site:=C2=A0 <a href=3D"http://www.gushi.org" rel=3D"noreferrer" target=3D"_=
blank">http://www.gushi.org</a><br>
---------------------------<br>
<br>
<br>
</blockquote></div><br clear=3D"all"><div>A) Use tput or an ANSI library to=
 obtain the code sequences based on the TERM setting instead of hard coding=
 them.<br><br>B) See vttest=C2=A0<a href=3D"https://invisible-island.net/vt=
test/vttest.html">https://invisible-island.net/vttest/vttest.html</a> for x=
term tests</div><div><br></div><span class=3D"gmail_signature_prefix">-- </=
span><br><div dir=3D"ltr" class=3D"gmail_signature">Visit <a href=3D"http:/=
/serverfault.com" target=3D"_blank">serverfault.com</a> to get your system =
administration questions answered.</div></div>

--000000000000c8d843060419cec6--