Comprehensive terminal settings for cross-platform compatibility.
Support for Linux, Windows, and macOS.
Easily enable/disable all the flags you want and toggle RawMode with just one instruction.
An intuitive API designed for ease of use, allowing developers to seamlessly integrate terminal settings into their applications with minimal effort.
Efficient and fast, ensuring minimal impact on your systemβs resources.
Highly configurable settings to tailor the terminal behavior to your needs.
Every function is rigorously tested, making the library safe, reliable, and ready for production.
πΉ π Quick Start β A quick guide to get you started with the library.
πΉ π API Reference β Detailed documentation of available functions.
If you have not already added the library to your project, please review the installation guide for more information.
const settings = @import("io").terminal.settings;
The
settings
module provides powerful tools for handling terminal settings. Letβs explore some of its features.
For example, letβs get the current terminal settings.
var terminal_settings = try settings.get();
Now, you can access the settings.
_ = terminal_settings.options.rawMode; // π true/false
// or
_ = settings.isRawModeEnabled(); // π true/false
Now, letβs change the terminal settings and apply the changes.
// change the terminal settings
terminal_settings.options.rawMode = true;
// apply the changes
try settings.set(terminal_settings);
Function | Description |
---|---|
get |
Get current terminal settings. |
set |
Set current terminal settings. |
enableRawMode |
Enable raw mode. |
disableRawMode |
Disable raw mode. |
isRawModeEnabled |
Returns true if raw mode is enabled. |
Field | Type | Description |
---|---|---|
core |
struct | to hold the os terminal settings. |
handles |
struct | to hold the os i/o handles. |
options |
TerminalOptions | to hold the terminal settings options(flags/modes). |
Field | Type | Description | Supported OS |
---|---|---|---|
rawMode |
bool | true if the raw mode is enabled. |
All |
echo |
bool | true if the echo is enabled. |
Linux |
canonical |
bool | true if the canonical input is enabled. |
Linux |
extended |
bool | true if the extended input processing is enabled. |
Linux |
signals |
bool | true if the signals (SIGINT , SIGTSTP , SIGTTIN , SIGTTOU ) are enabled. |
Linux |
Detailed terminal information ensuring cross-platform compatibility.
Utility functions for ANSI escape code manipulation and terminal styling.
Seamless Command Line Integration with ZIG.
Robust event handling for terminal key presses and mouse events.
Interactive prompts for user input.