Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
For those interested in learning more about terminal emulators and character graphics, checkout Nick Black's book Hacking the Planet (with Notcurses): A Guide to TUIs and Character Graphics[1].
While the overall focus of the book is on programming with Notcurses[2], the author shares a wealth of related info and history throughout its pages.
[1] https://nick-black.com/htp-notcurses.pdf
[2] https://github.com/dankamongmen/notcurses#readme
If someone wants to do this in Python, I made a lib for it: pip3 install ansi-escapes
It’s a port of sindresorhus’s ansi-escapes library. I find it way more convenient than looking up codes.
https://github.com/shawwn/ansi-escapes-python
See also ansi-styles, the lib that Chalk is based on. (Colors! You like colors? Are you a curmudgeony salt that refuses to use Rich for some reason? Use that.)
As with ansi-escapes, you can just pip install ansi-styles.
https://github.com/shawwn/ansi-styles-python
If someone wants to do this in Python, I made a lib for it: pip3 install ansi-escapes
It’s a port of sindresorhus’s ansi-escapes library. I find it way more convenient than looking up codes.
https://github.com/shawwn/ansi-escapes-python
See also ansi-styles, the lib that Chalk is based on. (Colors! You like colors? Are you a curmudgeony salt that refuses to use Rich for some reason? Use that.)
As with ansi-escapes, you can just pip install ansi-styles.
https://github.com/shawwn/ansi-styles-python
It's also fairly straightforward to strip escape codes if you need to using sed or similar[0], and there probably already exists a tool that will do just that specifically and more robustly than my example.
[0] Here's a basic example I wrote in Ruby: https://github.com/mike-bourgeous/mb-util/blob/5616cc4ce6218...
str.gsub(/\e\[[^A-Za-z~]*[A-Za-z~]/, '')