Do not ignore `BAT_CONFIG_PATH` if it doesn't exist. Both when
generating a new config file with `--generate-config-file` and
when attempting to read the config.
Also, provide a better error message in case the file can not
be created.
closes#1550
As discussed in #1519, the batcat snap package is too problematic for
official endorsement, so withdraw recommendation from README.me (and
remove section from CHANGELOG.md since a release with it has not been
made yet).
This combines ansi-light and ansi-dark into a single theme that works
with both light and dark backgrounds. Instead of specifying white/black,
the ansi theme uses the terminal's default foreground/background color
by setting alpha=01, i.e. #00000001. This is in addition to the alpha=00
encoding where red contains an ANSI color palette number.
Now, `--theme ansi-light` and `--theme ansi-dark` will print a
deprecation notice and use ansi instead (unless the user has a custom
theme named ansi-light or ansi-dark, which would take precedence).
The macOS version of mktemp does not recognize the --suffix option.
Using pure -d should work since, it seems [1], macOS 10.11 however.
So to make the script work on macOS, stop using the --suffix option.
The downside is of course that the temporary dir will have an anonymous
name, but I see no risk of confusion given how short-lived the usage of
the dir is, and given the context it is used.
[1] https://unix.stackexchange.com/questions/30091/fix-or-alternative-for-mktemp-in-os-x
This fixes#1438.
Note however, that using a pager such as less will add a newline itself.
So to actually not print a newline for such files, you need to either
disable paging:
bat --style=plain --paging=never no-newline-at-end-of-file.txt
or use a "pager" that does not add a newline:
bat --style=plain --pager=cat no-newline-at-end-of-file.txt
Note that we also update syntax tests file since a bunch of them had
missing newlines on the last lines.