Search code examples
perlspacingttyterminfo

How many spaces to a tab on this tty


I have a perl script that is writing to stdout which is a tty. Is there a way to determine how many spaces to a tab on that tty?


Solution

  • You want the 'it' capability from terminfo.

    use Term::Terminfo;
    my $ti = Term::Terminfo->new; 
    $tabsize = $ti->getnum( "it" );