Releases: sharkdp/bat
v0.18.0
Features
Bugfixes
- If the last line doesn't end with a newline character, don't add it if
--style=plain
, see #1438 (@Enselic) - Only print themes hint in interactive mode (
bat --list-themes
), see #1439 (@rsteube) - Make ./tests/syntax-tests/regression_test.sh work on recent versions of macOS, see #1443 (@Enselic)
- VimL syntax highlighting fix, see #1450 (@esensar)
- Print an 'Invalid syntax theme settings' error message if a custom theme is broken, see #614 (@Enselic)
- If plain mode is set and wrap is not explicitly opted in, long lines will no be truncated, see #1426
- If
PAGER
(but notBAT_PAGER
or--pager
) ismore
ormost
, silently useless
instead to ensure support for colors, see #1063 (@Enselic) - If
PAGER
isbat
, silently useless
to prevent recursion. ForBAT_PAGER
or--pager
, exit with error, see #1413 (@Enselic) - Manpage highlighting fix, see #1511 (@keith-hall)
BAT_CONFIG_PATH
ignored bybat
if non-existent, see #1550 (@sharkdp)
Other
- Performance improvements, see #1421 (@LovecraftianHorror)
- Added a new
--diagnostic
option to collect information for bug reports, see #1459 (@sharkdp) - Modified default theme colors to differentiate between a JSON key and a string value, see #1400 (@keith-hall)
- Upped min required Rust version to 1.42
Syntaxes
- Added Zig syntax, see #1470 (@paulsmith)
- Added Lean syntax, see #1446 (@Julian)
- Added
.resource
extension for Robot Framework files, see #1386 - Added
gnuplot
syntax, see #1431 (@sharkdp) - Highlight *.pac (Proxy auto-config) files as JavaScript, see #1515 (@sharkdp)
New themes
ansi
replacesansi-dark
andansi-light
, see #1104 and #1412 (@mk12). Breaking change: users that were previously using one of theansi-*
themes should switch toansi
.- The Gruvbox theme has been updated, see #1291 (@j0hnmeow). Breaking change: users that were previously using
gruvbox
orgruvbox-white
should update and usegruvbox-dark
/gruvbox-light
instead.
bat
as a library
- The following
PrettyPrinter
methods have been removed (they were previously deprecated):input_stdin_with_name
input_from_bytes_with_name
input_from_reader_with_name
vcs_modification_markers
(if thegit
feature is not enabled)
v0.17.1
v0.17.0
Features
- Added a new
--style
value,rule
, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan) - Pass
-S
("chop long lines") toless
if--wrap=never
is set inbat
, see #1255 (@gahag)
Bugfixes
- Detect infinite loop when input and output are the same, see #1193 and #1197 (@niklasmohrin)
- Throw an error when
bat
is being used aspager
, see #1343 (@adrian-rivera) - Bash syntax highlighting not selected for
*.ebuild
and*.eclass
files, see #1292 (@sharkdp) - Fix
zsh
completion when using-p
, see #1320 (@xzfc)
Other
- Add note to refer to see detailed help with
--help
(and vice versa with-h
), see #1215 (@henil) - Add a
Contributors
section toREADME
, see #1348 (@adrian-rivera)
Syntaxes
- Manpage syntax highlighting has been improved, see #1315 (@keith-hall)
- Add Svelte file syntax, see #1285 (@kjmph)
New themes
- Coldark, see #1329 (@ArmandPhilippot)
v0.16.0
Features
- Added support for the
NO_COLOR
environment variable, see #1021 and #1031 (@eth-p) - Added
-P
short flag to disable paging, see #1075 and #1082 (@LordFlashmeow) - Added
--force-colorization
/-f
flag to provide an alias for forced color and decoration output, see #1141 (@alexanderkarlis)
Bugfixes
- Fixed non-printable characters display for redirected output, see #1061 (@gsomix)
- Handle file extension conflicts in
--list-languages
, see #1076 and #1135 (@Kienyew)
Other
- Switched to "·" (U+00B7) Middle Dot from "•" (U+2022) Bullet for non-printing spaces, see #1056 and #1100 (@LordFlashmeow)
- Added zsh shell completion script, see #1136 (@Kienyew)
- Improved
--help
text (@sharkdp) - Added custom languages/themes sections to manpage (@eth-p)
Syntaxes
- Update AsciiDoc syntax, see #1034 (@rxt1077)
- GLSL (@caioalonso)
- Add Nginx and Apache config file syntax, see #1137 (@kjmph, @niklasmohrin)
- Use
fstab
syntax forcrypttab
files, see #1073 (@sharkdp) - Support syntax highlighting for files in
$XDG_CONFIG_HOME/git/
, see #1191 (@ahmedelgabri)
New themes
- Gruvbox, see #1069 (@KyleOndy)
- base16-256 for base16-shell users, see #1111 (@mk12)
bat
as a library
- Add APIs to provide
Input
descriptions withInputDescription
(@eth-p) - Add function to directly provide
Input
s toPrettyPrinter
(@eth-p) - Breaking:
Input::theme_preview_file
is no longer available. (@eth-p)
Packaging
- Package maintainers: note that we now include zsh shell completion files
- Removed build dependency on
liquid
(@sharkdp).
Thanks
Special thanks to @rivy for porting our CI/CD workflows to Github Actions. Also, many thanks to @Kienyew and @eth-p for major contributions!
v0.15.4
v0.15.3
v0.15.2
Warning: this release suffers from #1022. bat
will panic when called with a relative file path.
Bugfixes
--map-syntax
doesn't work with names provided through--file-name
(@eth-p)- Fix syntax detection for files called 'rails', see #1008
- Fix potential errors with syntax detection for symlinked files, see #1001
Other
- Add padding above headers when not using a grid, see #968 and #981 (@pt2121)
- bat now prints an error if an invalid syntax is specified via
-l
or--map-syntax
, see #1004 (@eth-p)
bat
as a library
PrettyPrinter::vcs_modification_markers
has been marked deprecated when building without thegit
feature, see #997 and #1020 (@eth-p, @sharkdp)
Packaging
- Compilation problems with
onig_sys
on various platforms have been resolved by upgrading tosyntect 4.2
, which includes a newonig
version that allows to buildonig_sys
without thebindgen
dependency. This removes the need forlibclang(-dev)
to be installed to compilebat
. Package maintainers might want to removeclang
as a build dependency. See #650 for more details.
v0.15.1
Bugfixes
- Fix highlighting of Markdown files, see #963 and #977
- Fix
base16
theme (was broken since in v0.14), see #972, #934 and #979 (@mk12).
Users suffering from #865 ("no color for bat in ssh from a Windows client") can use theansi-dark
andansi-light
themes from now on.
New syntaxes
- Fortran, see #957
- Email (@mariozaizar)
- QML, see #962 (@pylipp)
v0.15.0
Features
-
This release adds a new
--diff
/-d
option that can be used to only show lines surrounding Git changes, i.e. added, removed or modified lines. The amount of additional context can be controlled with--diff-context=N
. See #23 and #940You can use a bash function like
batdiff() { git diff --name-only --diff-filter=d 2>/dev/null | xargs bat --diff }
to essentially get a version of
git diff
with syntax highlighting (but without being able to see the old version).
Bugfixes
- Error message printed in the middle of the output for another file, see #946
- Performance improvements when using custom caches (via
bat cache --build
): thebat
startup time should now be twice as fast (@lzutao).
Themes
- Updated version of the Solarized dark/light themes, see #941
bat
as a library
- There are a few changes in the "low level" API (the
Config
struct has changed and
the error handler needs a new&mut dyn Write
argument). The high-level API is not
affected.
v0.14.0
Features
- Added a new
--file-name <name>…
option to overwrite the displayed filename(s)
in the header. This is useful when piping input intobat
. See #654 and #892 (@neuronull). - Added a new
--generate-config-file
option to create an initial configuration file
at the right place. See #870 (@jmick414)
Bugfixes
- Performance problems with C# source code have been fixed, see #677 (@keith-hall)
- Performance problems with Makefiles have been fixed, see #750 (@keith-hall)
- Fix bug when highlighting Ruby files with unindented heredocs, see #914 (@keith-hall)
- A highlighting problem with Rust source code has been fixed, see #924 (@keith-hall)
- Windows: short files that do not require paging are displayed and then lost, see #887
--highlight-line
did not work correctly in combination with--tabs=0
and--wrap=never
,
see #937
Other
- When saving/reading user-provided syntaxes or themes,
bat
will now maintain a
metadata.yaml
file which includes information about thebat
version which was
used to create the cached files. When loading cached files, we now print an error
if they have been created with an incompatible version. See #882 - Updated
liquid
dependency to 0.20, see #880 (@ignatenkobrain)
bat
as a library
-
A completely new "high level" API has been added that is much more convenient
to use. See theexamples
folder for the updated code. The older "low level"
API is still available (basically everything that is not in the rootbat
module), but has been refactored quite a bit. It is recommended to only use
the new "high level" API, if possible. This will be much easier to keep stable.
Note that this should still be considered a "beta" release ofbat
-as-a-library.
For more details and some screenshots of the example programs, see #936. -
Stripped out a lot of binary-only dependencies, see #895 and #899 (@dtolnay)
This introduces a
features = ["application"]
which is enabled by default and pulls in
everything required bybat
the application. When depending on bat as a library, downstream
Cargo.toml
should disable this feature to cut out inapplicable heavy dependencies:[dependencies] bat = { version = "0.14", default-features = false, features = ["regex-onig"] }
Other optional functionality has also been put behind features:
paging
andgit
support. -
Allow using the library with older syntect, see #896 and #898 (@dtolnay)
New syntaxes
- Rego, see #872 (@patrick-east)
- Stylo, see #917
Thanks
Many thanks to @keith-hall for all the help with various Sublime syntax problems!