Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BAT_THEME_DARK and BAT_THEME_LIGHT don't work while --theme-dark and --theme-light do #3171

Open
sherif-fanous opened this issue Jan 9, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@sherif-fanous
Copy link

What steps will reproduce the bug?

  1. export BAT_THEME_DARK="Catppuccin Macchiato"
  2. export BAT_THEME_LIGHT="Catppuccin Latte"
  3. bat lib/util/resource.py

What happens?

bat prints the file using the default theme

What did you expect to happen instead?

bat to print the file using either the dark or light theme specified using the environment variables

This works using the command line arguments as invoking bat --theme-dark="Catppuccin Macchiato" --theme-light="Catppuccin Latte" lib/util/resource.py has bat printing the file using the correct Catppuccin theme depending on whether the system is in dark/light mode

How did you install bat?

homebrew


bat version and environment

Software version

bat 0.25.0

Operating system

  • OS: macOS 15.2 Sequoia
  • Kernel: 24.2.0

Command-line

bat lib/util/resource.py --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=<not set>
COLORTERM=truecolor
LANG=en_CA.UTF-8
LC_ALL=<not set>
LESS=-R
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=less
SHELL=/bin/zsh
TERM=xterm-ghostty
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 '/Users/sherif/.config/bat/config': No such file or directory (os error 2).

Custom assets metadata

bat_version: 0.25.0
creation_time:
  secs_since_epoch: 1736386552
  nanos_since_epoch: 315366000

Custom assets

  • metadata.yaml, 97 bytes
  • syntaxes.bin, 969578 bytes
  • themes.bin, 49230 bytes

Compile time information

  • Profile: release
  • Target triple: aarch64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: aarch64
  • Pointer width: 64
  • Endian: little
  • CPU features: aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh
  • Host: aarch64-apple-darwin

Less version

> less --version
less 581.2 (POSIX regular expressions)
Copyright (C) 1984-2021  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
@sherif-fanous sherif-fanous added the bug Something isn't working label Jan 9, 2025
@keith-hall
Copy link
Collaborator

Thanks for reporting. A PR fixing this can be found here: #3168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants