GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Term::Choose::LineFold(3) User Contributed Perl Documentation Term::Choose::LineFold(3)

Term::Choose::LineFold

Version 1.775

Width in this context refers to the number of occupied columns of a character string on a terminal with a monospaced font.

By default ambiguous width characters are treated as half width. If the environment variable "TC_AMBIGUOUS_WIDTH_IS_WIDE" is set to a true value, ambiguous width characters are treated as full width.

If the optional Term::Choose::LineFold::XS module is installed, its functions will be used automatically in place of the pure-Perl implementations, providing faster performance.

Nothing by default.

    use Term::Choose::LineFold qw( print_columns );

Get the number of occupied columns of a character string on a terminal.

The string passed to this function is a decoded string, free of control characters, non-characters, and surrogates.

    $print_width = print_columns( $string );

Fold a string.

This function accepts a decoded string. Control characters (excluding vertical spaces), non-characters, and surrogates are removed before the string is folded. Changes are applied to a copy; the passed string is unchanged.

    $folded_string = line_fold( $string );
    $folded_string = line_fold( $string, { width => 120, color => 1 } );

Options

If not set, defaults to the terminal width.

width is 1 or greater.

Sets the initial tab inserted at the beginning of paragraphs. If a value consisting of "/^[0-9]+$/" is provided, the tab will be that number of spaces. Otherwise, the provided value is used directly as the tab. By default, no initial tab is inserted. If the initial tab is longer than half the available width, it will be cut to half the available width.
Sets the subsequent tab inserted at the beginning of all broken lines (excluding paragraph beginnings). If a value consisting of "/^[0-9]+$/" is provided, the tab will be that number of spaces. Otherwise, the provided value is used directly as the tab. By default, no subsequent tab is inserted. If the subsequent tab is longer than half the available width, it will be cut to half the available width.
Enables support for ANSI SGR escape sequences. If enabled, all zero-width no-break spaces (0xfeff) are removed.

color is 0 or 1.

Matthäus Kiem <cuer2s@gmail.com>

Copyright (C) 2025 Matthäus Kiem.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For details, see the full text of the licenses in the file LICENSE.

2025-06-11 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.