The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

SHARYANTO::Role::TermAttrs - Role for terminal-related attributes

VERSION

version 0.67

DESCRIPTION

This role gives several options to turn on/off terminal-oriented features like whether to use UTF8 characters, whether to use colors, and color depth. Defaults are set from environment variables or by detecting terminal software/capabilities.

ATTRIBUTES

use_utf8 => BOOL (default: from env, or detected from terminal)

The default is retrieved from environment: if UTF8 is set, it is used. Otherwise, the default is on if terminal emulator software supports Unicode and language (LANG/LANGUAGE) setting has /utf-?8/i in it.

use_box_chars => BOOL (default: from env, or detected from OS)

Default is 0 for Windows.

interactive => BOOL (default: from env, or detected from terminal)

use_color => BOOL (default: from env, or detected from terminal)

color_depth => INT (default: from env, or detected from terminal)

term_width => INT (default: from env, or detected from terminal)

term_height => INT (default: from env, or detected from terminal)

METHODS

detect_terminal() => HASH

Call Term::Detect::Software's detect_terminal_cached.

ENVIRONMENT

  • UTF8 => BOOL

    Can be used to set use_utf8.

  • INTERACTIVE => BOOL

    Can be used to set interactive.

  • COLOR => BOOL

    Can be used to set use_color.

  • COLOR_DEPTH => INT

    Can be used to set color_depth.

  • BOX_CHARS => BOOL

    Can be used to set use_box_chars.

  • COLUMNS => INT

    Can be used to set term_width.

  • LINES => INT

    Can be used to set term_height.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/SHARYANTO-Roles.

SOURCE

Source repository is at https://github.com/sharyanto/perl-SHARYANTO-Roles.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=SHARYANTO-Roles

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Steven Haryanto <stevenharyanto@gmail.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by Steven Haryanto.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.