Skip to content

Commit

Permalink
Disable termcap warning when TERM is unset
Browse files Browse the repository at this point in the history
Upstream-URL:
rafl/term-readline#5
  • Loading branch information
atoomic committed Mar 30, 2022
1 parent f60dc0a commit 63d3bca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dist/Term-ReadLine/lib/Term/ReadLine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ our $rl_term_set = ',,,';
our $terminal;
sub LoadTermCap {
return if defined $terminal;

return unless $ENV{'TERM'};
require Term::Cap;
$terminal = Tgetent Term::Cap ({OSPEED => 9600}); # Avoid warning.
}
Expand All @@ -388,7 +388,7 @@ sub ornaments {
my @ts = split /,/, $rl_term_set, 4;
eval { LoadTermCap };
unless (defined $terminal) {
warn("Cannot find termcap: $@\n") unless $Term::ReadLine::termcap_nowarn;
warn("Cannot find termcap: $@\n") if $ENV{'TERM'} && ! $Term::ReadLine::termcap_nowarn;
$rl_term_set = ',,,';
return;
}
Expand Down

0 comments on commit 63d3bca

Please sign in to comment.