A Java library for ANSI escape sequence support in console output, including Windows compatibility.
Jansi is a Java library that provides ANSI escape sequence support for console output formatting, enabling colored and styled text in terminal applications. It solves the problem of inconsistent ANSI support across platforms, particularly on Windows where native terminal handling lacks ANSI capabilities. The library automatically adapts to the terminal environment, stripping escape codes when output is redirected to files.
Java developers building command-line interfaces (CLIs), terminal-based tools, or applications requiring formatted console output across different operating systems.
Developers choose Jansi for its seamless cross-platform ANSI support, especially on Windows, without needing to write platform-specific code. Its simple API and automatic handling of terminal detection make it a reliable solution for consistent console formatting.
Jansi is a small java library that allows you to use ANSI escape sequences to format your console output which works even on windows.
Uses JNI libraries to provide native ANSI escape sequence support on Windows, solving the platform's lack of built-in ANSI handling as highlighted in the README's features.
Automatically detects when output is redirected to files and strips ANSI codes, preventing unreadable escape sequences in logs, a key feature mentioned in the synopsis.
Offers a fluent builder API for constructing ANSI sequences programmatically, with examples like `ansi().fg(RED).a('Hello')` for easy formatting, as shown in the usage section.
Provides JNI bindings to platform-specific APIs like Kernel32 and CLibrary, enabling deeper terminal control beyond basic ANSI codes, as noted in the features list.
The library is no longer maintained and has been merged into org.jline:jansi, meaning no future updates, bug fixes, or security patches from the original source, as warned in the README.
Relies on native libraries, which can complicate deployment, cause compatibility problems across JVM versions, and trigger security alerts in restricted environments.
Focuses on basic ANSI escape codes for color and text formatting, lacking support for advanced terminal capabilities like emojis, graphics, or rich interactive components.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.