3 ms·
> From the tone of this piece I gather that the ANSI escape codes are actually standard enough to target. termfo[1] comes with a "termfo" CLI utility which – a
by Beltalowda 4y ago
> From the tone of this piece I gather that the ANSI escape codes are actually standard enough to target.
termfo[1] comes with a "termfo" CLI utility which – among other things – can group terminals by escape code; for example "termfo find-cap save_cursor" shows that almost all terminals use "\x1b7", with just a few very old ones using something different (full output is a bit long, but it's at [2]).
It's useful to check "can I safely hard-code this escape code?" But like you said: for ANSI it's pretty safe to just hard-code most codes, especially the common ones, but never hurts to check.
[1]: https://github.com/arp242/termfo https://github.com/arp242/termfo
[2]: https://pastebin.com/raw/pVHGR6aZ https://pastebin.com/raw/pVHGR6aZ