diff options
author | Eric Wong <e@80x24.org> | 2021-04-28 07:52:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-04-28 19:31:00 +0000 |
commit | ee8f9846c4641d4b23a03aa09b512ff0c597d2ec (patch) | |
tree | d801436d14fce2c3f352365223dd99e3240389a8 /lib/PublicInbox/LeiViewText.pm | |
parent | 56f7fa78653320ec0fd250e1416f4f25221fc793 (diff) | |
download | public-inbox-ee8f9846c4641d4b23a03aa09b512ff0c597d2ec.tar.gz |
This should be familiar to git users who wish to force color when writing to pipes or disable color.
Diffstat (limited to 'lib/PublicInbox/LeiViewText.pm')
-rw-r--r-- | lib/PublicInbox/LeiViewText.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiViewText.pm b/lib/PublicInbox/LeiViewText.pm index e0d62c0d..d0f8b7f4 100644 --- a/lib/PublicInbox/LeiViewText.pm +++ b/lib/PublicInbox/LeiViewText.pm @@ -69,7 +69,7 @@ sub uncolored { ${$_[0]->{obuf}} .= $_[2] } sub new { my ($cls, $lei) = @_; my $self = bless { %{$lei->{opt}}, -colored => \&uncolored }, $cls; - return $self unless $self->{color} || -t $lei->{1}; + return $self unless $self->{color} //= -t $lei->{1}; my $cmd = [ qw(git config -z --includes -l) ]; my ($r, $pid) = popen_rd($cmd, undef, { 2 => $lei->{2} }); my $cfg = PublicInbox::Config::config_fh_parse($r, "\0", "\n"); |