ANSI Escape Codes

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • notcurses

    blingful character graphics/TUI library. definitely not curses.

  • 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

  • ansi-escapes-python

    ANSI escape codes for manipulating the terminal

  • 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

  • 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.

    WorkOS logo
  • ansi-styles-python

    ANSI escape codes for styling strings in the terminal

  • 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

  • mb-util

    OS- and data-manipulation utility functions not otherwise categorizable

  • 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~]/, '')

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts