Question

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?

Was it helpful?

Solution

You want the 'it' capability from terminfo.

use Term::Terminfo;
my $ti = Term::Terminfo->new; 
$tabsize = $ti->getnum( "it" );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top