Skip to content

--theme auto results in the fallback to the default theme #3641

@savchenko

Description

@savchenko

What steps will reproduce the bug?

  1. Configure the environment as following:

    BAT_PAGER=less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse
    BAT_STYLE=plain,changes
    BAT_THEME=auto
    BAT_THEME_DARK=neovim-dark
    BAT_THEME_LIGHT=neovim-light
    
  2. Launch a dark terminal. I am using foot version 1.26.1 with $TERM set to foot-direct. Here are the colours:

    Image

  3. Create a tiny foo.py to test the highlighting:

    def foo(bar: list[int]) -> str:
        baz, *blah = bar
        return f"{baz}-{blah}"
    
    print(foo([1, 2, 3, 4]))

What happens?

  1. bat foo.py falls back to the default theme:

    Image

What did you expect to happen instead?

When terminal is dark (also, org.gnome.desktop.interface color-scheme is prefer-dark), I would expect bat to respect the BAT_THEME=auto as per manual. So when the terminal is dark it should be:

Image

And when the terminal is light:

Image

How did you install bat?

GitHub release.


bat version and environment

bat 0.25.0

bat has been built without the 'bugreport' feature. The '--diagnostic' option is not available.

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