Skip to content

--style=auto isn't the default despite documentation #1742

@lilyball

Description

@lilyball

Describe the bug you encountered:

The manpage and --help output document that --style=auto is the default behavior. But this does not appear to be the case. Instead it appears that --style=full is the default.

Example:

> BAT_CONFIG_PATH= bat -f nix-homepage | cat
───────┬────────────────────────────────────────────────────────────────────────
       │ File: nix-homepage
───────┼────────────────────────────────────────────────────────────────────────
   1   │ #!/usr/bin/env bash
   2   │ 
   3   │ set -euo pipefail
…

What did you expect to happen instead?

It should have looked like

> BAT_CONFIG_PATH= bat --style=auto -f nix-homepage | cat
#!/usr/bin/env bash

set -euo pipefail
…

How did you install bat?

Nix


bat version and environment

Software version

bat 0.18.0

Operating system

Darwin 20.5.0

Command-line

/Users/lily/.nix-profile/bin/bat -f nix-homepage --diagnostic 

Environment variables

SHELL=/Users/lily/.local/share/home-manager/bin/fish
PAGER='less -R'
BAT_PAGER=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=<not set>
NO_COLOR=<not set>
MANPAGER=<not set>

Config file

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

[Note: Specifying BAT_CONFIG_PATH=/dev/null removes this diagnostic error but doesn't change the observed behavior. Maybe bat should just test if BAT_CONFIG_PATH is set to the empty string before trying to open it? This should still disable the config file of course]

Compile time information

  • Profile: release
  • Target triple: x86_64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: x86_64
  • Pointer width: 64
  • Endian: little
  • CPU features: fxsr,sse,sse2,sse3,ssse3
  • Host: x86_64-apple-darwin

Less version

> less --version 
less 563 (POSIX regular expressions)
Copyright (C) 1984-2020  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: http://www.greenwoodsoftware.com/less

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions