When I output tput clear | hexdump -c
I get different results if I'm on kitty
or xterm
. How can I use Term::Cap
to generate these terminal signals on the respective terminal?
What I've tried is a direct-copy-paste from the docs with setup,
use strict;
use warnings;
use Term::Cap;
use POSIX;
my $termios = new POSIX::Termios;
$termios->getattr;
my $ospeed = $termios->getospeed;
my $terminal = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed };
And then I thought this should work,
$terminal->Tputs('clear', 1, *STDOUT );
But alas, it does nothing.
If I provide a different non-existent name for the term (rather than undef
which defaults to $ENV{TERM}
, I get)
Can't find a valid termcap file at ./test.pl line 9.
So I know it's looking up the termcap
file, and finding it.