Bat: base16 colors are wrong starting in 0.14.0

Created on 7 May 2020  路  3Comments  路  Source: sharkdp/bat

What version of bat are you using?
bat 0.15.0

Describe the bug you encountered:
I'm using the base16 theme, with a dark terminal. bat 0.13.0 renders output as expected, and in a way consistent with other tools configured with a base16 theme. However bat 0.15.0 renders comments using the base00 color, which is black and matches my background. This makes comments invisible (modulo the fact that my terminal background is semi-transparent).

This is in Terminal.app on macOS. If it matters, Terminal.app supports 256 colors but not customizable RGB colors, though the base16 theme should only be using the first 16 colors anyway.

Screenshot of bat 0.13.0

Screen Shot 2020-05-07 at 1 59 37 PM


Screenshot of bat 0.15.0

Screen Shot 2020-05-07 at 1 59 50 PM

Also from these screenshots I can see the {0.2} changed from orange to red. This is the same underlying issue.

It looks like this is caused by 319ab779ee6bc8954e7beb2ae34c43d9f327322e, which teaches bat explicitly about base16 colors, except bat's only using the lower 8 colors, with a TODO comment saying it should be using high-intensity variants. The lack of high intensity variants is in fact a huge problem.

Describe what you expected to happen?
bat 0.15.0 shouldn't render colors any differently than bat 0.13.0.

How did you install bat?
Nix


system

$ uname -srm
Darwin 19.4.0 x86_64

$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.4
BuildVersion: 19E287

bat

$ bat --version
bat 0.15.0

$ env

bat_config

$ cat /Users/lily/.config/bat/config

--theme="base16"
--italic-text=always

bat_wrapper

$ cat /nix/store/dr1d3f2p48izs3bc7873bal5np9mcajl-bat-0.15.0/bin/bat

#! /nix/store/8wg8zdcq0iyx2hdqvc44h5z7cwy95s3c-bash-4.4-p23/bin/bash -e
export PATH='/nix/store/jn33gx66h053w6xijwixsnsn3vaj0qyn-less-551/bin'${PATH:+':'}$PATH
exec -a "$0" "/nix/store/dr1d3f2p48izs3bc7873bal5np9mcajl-bat-0.15.0/bin/.bat-wrapped"  "$@"

bat_wrapper_function

No wrapper function for 'bat'.

No wrapper function for 'cat'.

tool

$ less --version
less 487 (POSIX regular expressions)

bug

All 3 comments

Thank you for reporting this. I accidentally broke this with #934. See the fix in #972.

closed via #972 by @mk12

Released in v0.15.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

niedzielski picture niedzielski  路  3Comments

issmirnov picture issmirnov  路  3Comments

antoinemadec picture antoinemadec  路  3Comments

rien333 picture rien333  路  3Comments

tomgoren picture tomgoren  路  3Comments