Skip to content

Help text does not respect custom theme #3559

@JakePi3

Description

@JakePi3

What steps will reproduce the bug?

docker run -d debian:trixie-slim bash -c "
apt-get update && apt-get install -y curl gnupg && \
curl -fsSL https://mise.jdx.dev/gpg-key.pub | gpg --dearmor -o /usr/share/keyrings/mise-archive-keyring.gpg && \
echo 'deb [signed-by=/usr/share/keyrings/mise-archive-keyring.gpg] https://mise.jdx.dev/deb stable main' | tee /etc/apt/sources.list.d/mise.list && \
apt-get update -y && \
apt-get install -y mise && \
mise use bat@latest && \
mkdir -p /root/.config/bat/themes && \
cd /root/.config/bat/themes && \
curl -O https://raw.github.com/folke/tokyonight.nvim/main/extras/sublime/tokyonight_night.tmTheme && \
mise x bat -- bat cache --build && \
sleep infinity
"

# CONNECT TO CONTAINER CREATED ABOVE

$ eval "$(mise activate bash)"
$ export BAT_THEME=tokyonight_night
$ bat --help
[bat warning]: Unknown theme 'tokyonight_night', using default.
...

What happens?
Help is displayed using default theme instead of custom theme I downloaded. Cache has been built, and I can see files rendered in the correct theme, but not the help text.

What did you expect to happen instead?
I expected the theme to be loaded and used. The load fails but only for --help screen. If the help screen is not meant to be used with a theme, I would not expect the warning.

How did you install bat?
Use mise running on Docker, see command at the top to replicate the image.


bat version and environment
Bat version 0.26.1
Installed on Docker image debian trixie slim
Using mise

Software version

bat 0.26.1 (979ba22)

Operating system

  • OS: Linux (Debian GNU/Linux 13)
  • Kernel: 6.18.3-arch1-1

Command-line

bat --diagnostic

Environment variables

BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=tokyonight_night
COLORTERM=truecolor
LANG=C.UTF-8
LC_ALL=C.UTF-8
LESS=<not set>
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=<not set>
SHELL=/bin/bash
TERM=screen
XDG_CACHE_HOME=<not set>
XDG_CONFIG_HOME=<not set>

System Config file

Could not read contents of '/etc/bat/config': No such file or directory (os error 2).

Config file

Could not read contents of '/home/developer/.config/bat/config': No such file or directory (os error 2).

Custom assets metadata

bat_version: 0.26.1
creation_time:
  secs_since_epoch: 1769562524
  nanos_since_epoch: 538515701

Custom assets

  • metadata.yaml, 97 bytes
  • syntaxes.bin, 1012454 bytes
  • themes.bin, 62325 bytes

Compile time information

  • Profile: release
  • Target triple: x86_64-unknown-linux-musl
  • Family: unix
  • OS: linux
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2
  • Host: x86_64-unknown-linux-gnu

Less version

> less --version
less 668 (GNU regular expressions)
Copyright (C) 1984-2024  Mark Nudelman

less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions