2

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?

Ether
  • 53,118
  • 13
  • 86
  • 159
pythonic metaphor
  • 10,296
  • 18
  • 68
  • 110

1 Answers1

8

You want the 'it' capability from terminfo.

use Term::Terminfo;
my $ti = Term::Terminfo->new; 
$tabsize = $ti->getnum( "it" );
Leolo
  • 1,327
  • 9
  • 14
  • What does the "it"-argument mean? – sid_com Nov 12 '10 at 16:08
  • @sid_com - init_tabs. Google's your friend. One of the first 3 links on googling "terminfo it tab" yields: "it# - Initial number of spaces between tabs."; http://www.comptechdoc.org/os/linux/howlinuxworks/linux_hltermcommands.html – DVK Nov 12 '10 at 17:16