A pure Bash script to generate ANSI escape codes for terminal text styling, cursor control, and display manipulation.
ANSI is a pure Bash script that generates ANSI escape sequences for terminal manipulation. It allows developers to change text colors, move the cursor, apply text attributes (like bold or underline), and control display elements directly from shell scripts or command lines. It solves the problem of adding rich terminal styling without relying on external tools or complex libraries.
Shell script developers and system administrators who need to enhance terminal output with colors, dynamic cursor positioning, or basic UI elements in Bash environments.
Developers choose ANSI because it's lightweight, dependency-free, and written entirely in Bash, making it highly portable. It offers a comprehensive set of terminal control features without the overhead of larger libraries like ncurses.
ANSI escape codes in pure bash - change text color, position the cursor, much more
Uses only Bash built-ins, ensuring compatibility across systems where Bash is available, as emphasized in the Philosophy section and installation notes.
Offers extensive options for text styling, cursor movement, display manipulation, and terminal reporting, covering colors, attributes, and queries like window size.
Can be used as both a command-line tool and sourced as a Bash library with mirrored functions, allowing for programmatic control in scripts.
Includes built-in options like --color-table and --color-codes to visualize available colors and codes, making it easier to choose styles.
Not all features work on all terminals, and support varies, leading to inconsistent behavior; the README explicitly warns about this.
The project reversed its newline handling in August 2018, causing upgrade issues and potential confusion for existing users, as noted in the Upgrading Issues section.
Installation involves downloading and manually placing the script in the PATH or using BPM, which is more cumbersome than standard package managers.
Reporting features require stdin to be available and may fail silently on unsupported terminals, as mentioned in the Reporting section.
Master the command line, in one page
ShellCheck, a static analysis tool for shell scripts
A guide to learn bash
A shell parser, formatter, and interpreter with bash and zsh support; includes shfmt
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.