Skip to content

Releases: sharkdp/bat

v0.23.0

25 Mar 09:33
Compare
Choose a tag to compare

Features

  • Implemented -S and --chop-long-lines flags as aliases for --wrap=never. See #2309 (@johnmatthiggins)
  • Breaking change: Environment variables can now override config file settings (but command-line arguments still have the highest precedence), see #1152, #1281, and #2381 (@aaronkollasch)
  • Implemented --nonprintable-notation=caret to support showing non-printable characters using caret notation. See #2429 (@einfachIrgendwer0815)

Bugfixes

  • Fix bat cache --clear not clearing the --target dir if specified. See #2393 (@miles170)

Other

Syntaxes

v0.22.1

10 Sep 18:09
Compare
Choose a tag to compare

Bugfixes

  • Bring back pre-processing of ANSI escape characters to so that some common bat use cases starts working again. See #2308 (@Enselic)

v0.22.0

06 Sep 20:55
Compare
Choose a tag to compare

Features

Bugfixes

  • Prevent fork nightmare with PAGER=batcat. See #2235 (@johnmatthiggins)
  • Make --no-paging/-P override --paging=... if passed as a later arg, see #2201 (@themkat)
  • --map-syntax and --ignored-suffix now works together, see #2093 (@czzrr)
  • Strips byte order mark from output when in non-loop-through mode. See #1922 (@dag-h)

Other

  • Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
  • Improved fish completions. See #2275 (@zgracem)
  • Stop pre-processing ANSI escape characters. Syntax highlighting on ANSI escaped input is not supported. See #2185 and #2189 (@Enselic)

Syntaxes

  • NSE (Nmap Scripting Engine) is mapped to Lua, see #2151 (@Cre3per)
  • Correctly color fstab dump and pass fields, see #2246 (@yuvalmo)
  • Update Command Help syntax, see #2255
  • Julia: Fix syntax highlighting for function name starting with struct, see #2230
  • Minor update to LiveScript, see #2291
  • Associate .mts and .cts files with the TypeScript syntax. See #2236 (@kidonng)
  • Fish history is mapped to YAML. See #2237 (@kidonng)

bat as a library

  • Make bat::PrettyPrinter::syntaxes() iterate over new bat::Syntax struct instead of &syntect::parsing::SyntaxReference. See #2222 (@Enselic)
  • Clear highlights after printing, see #1919 and #1920 (@rhysd)

v0.21.0

12 May 11:39
Compare
Choose a tag to compare

Features

Bugfixes

Performance

  • Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
  • Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)

Other

Syntaxes

  • Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
  • log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
  • Associate /var/spool/mail/* and /var/mail/* with the Email syntax. See #2156 (@cyqsimon)
  • Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
  • Slightly adjust Zig syntax. See #2136 (@Enselic)
  • Associate .inf files with the INI syntax. See #2190 (@Enselic)

bat as a library

  • Allow configuration of show_nonprintable with PrettyPrinter, see #2142
  • The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
  • Mark bat::error::Error enum as #[non_exhaustive] to allow adding new variants without future semver breakage. See #2181 (@Enselic)
  • Change Error::SyntectError(syntect::LoadingError) to Error::SyntectError(syntect::Error). See #2181 (@Enselic)
  • Add Error::SyntectLoadingError(syntect::LoadingError) enum variant. See #2181 (@Enselic)

v0.20.0

27 Feb 07:16
Compare
Choose a tag to compare

Features

  • New style component header-filesize to show size of the displayed file in the header. See #1988 (@mdibaiee)
  • Use underline for line highlighting on ANSI, see #1730 (@mdibaiee)

Bugfixes

Syntaxes

  • GraphQL: Add support for interfaces implementing interfaces and consider ampersand an operator. See #2000
  • Associate _vimrc and _gvimrc files with the VimL syntax. See #2002
  • Associate poetry.lock files with the TOML syntax. See #2049
  • Associate .mesh, .task, .rgen, .rint, .rahit, .rchit, .rmiss, and .rcall with the GLSL syntax. See #2050
  • Added support for JQ syntax, see #2072 (@clarfonthey)
  • Properly associate global git config files rooted in $XDG_CONFIG_HOME/git/ or $HOME/.config/git/. See #2067 (@cyqsimon)

bat as a library

  • Exposed get_syntax_set and get_theme methods on HighlightingAssets. See #2030 (@dandavison)
  • Added HeaderFilename and HeaderFilesize to StyleComponent enum, and mark it #[non_exhaustive]. See #1988 (@mdibaiee)

v0.19.0

08 Jan 17:02
Compare
Choose a tag to compare

Performance

  • Reduce startup time in loop-through mode (e.g. when redirecting output) by 90%. See #1747 (@Enselic)
  • Load themes lazily to make bat start 25% faster when disregarding syntax load time. See #1969 (@Enselic)
  • Python syntax highlighting no longer suffers from abysmal performance in specific scenarios. See #1688 (@keith-hall)
  • Fix for poor performance when ANSI escape sequences are piped to bat, see #1596 (@eth-p)
  • Fix for incorrect handling of ANSI escape sequences when using --wrap=never, see #1596 (@eth-p)
  • Load custom assets as fast as integrated assets, see #1753 (@Enselic)

Features

  • Support for x:-delta (minus) syntax in line ranges (e.g. 20:-10). See #1901 (@bojan88)
  • Support for --ignored-suffix argument. See #1892 (@bojan88)
  • $BAT_CONFIG_DIR is now a recognized environment variable. It has precedence over $XDG_CONFIG_HOME, see #1727 (@billrisher)
  • Support for x:+delta syntax in line ranges (e.g. 20:+10). See #1810 (@bojan88)
  • Add new --acknowledgements option that gives credit to theme and syntax definition authors. See #1971 (@Enselic)
  • Include git hash in bat -V and bat --version output if present. See #1921 (@Enselic)

Bugfixes

Other

Syntaxes

bat as a library

  • Deprecate HighlightingAssets::syntaxes() and HighlightingAssets::syntax_for_file_name(). Use HighlightingAssets::get_syntaxes() and HighlightingAssets::get_syntax_for_path() instead. They return a Result which is needed for upcoming lazy-loading work to improve startup performance. They also return which SyntaxSet the returned SyntaxReference belongs to. See #1747, #1755, #1776, #1862 (@Enselic)
  • Remove HighlightingAssets::from_files and HighlightingAssets::save_to_cache. Instead of calling the former and then the latter you now make a single call to bat::assets::build. See #1802, #1971 (@Enselic)
  • Replace the error::Error(error::ErrorKind, _) struct and enum with an error::Error enum. Error(ErrorKind::UnknownSyntax, _) becomes Error::UnknownSyntax, etc. Also remove the error::ResultExt trait. These changes stem from replacing error-chain with thiserror. See #1820 (@Enselic)
  • Add new MappingTarget enum variant MapExtensionToUnknown. Refer to its documentation for more information. Also mark MappingTarget as #[non_exhaustive] since more enum variants might be added in the future. See #1703 (@cbolgiano), #2012 (@Enselic)

v0.18.3

22 Aug 16:48
Compare
Choose a tag to compare

Bugfixes

  • Bump git2 dependency to fix build with Rust 1.54, see #1761

v0.18.2

13 Jul 10:01
Compare
Choose a tag to compare

Features

  • Ignore known backup/template filename suffixes when selecting the syntax, see #1687 (@scop)

Bugfixes

  • Fix for a security vulnerability on Windows (CVE-2021-36753). Prior to this release, bat would execute programs called less/less.exe from the current working directory (instead of the one from PATH) with priority. An attacker might be able to use this by placing a malicious program in a shared directory where the user would execute bat. bat users on Windows are advised to upgrade to this version. See #1724 and #1472 (@Ry0taK).

Other

Syntaxes

v0.18.1

13 May 08:08
3aea514
Compare
Choose a tag to compare

Bugfixes

  • Mouse support and screen clearing broken for less versions with minor version number (581.2), see #1629 and #1639 (@aswild)

Other

  • Input::ordinary_file and Input::with_name now accept Path rather than OsStr see #1571 (@matklad)
  • The LESS environment variable is now included in bat --diagnostic, see #1589 (@Enselic)
  • Increased min. required Rust version to 1.45

Syntaxes

  • Improved the Syslog syntax highlighting, see #1606 (@keith-hall)
  • Replaced "Advanced CSV" with a custom CSV syntax definition written especially for bat; see #1574 (@keith-hall)
  • Added SystemVerilog file syntax, see #1580 (@SeanMcLoughlin)
  • Added Solidity and Vyper syntax, see #1602 (@Ersikan)

New themes

v0.18.0

28 Feb 22:25
Compare
Choose a tag to compare

Features

  • Use a pager when bat --list-languages is called, see #1394 (@stku1985)

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 not BAT_PAGER or --pager) is more or most, silently use less instead to ensure support for colors, see #1063 (@Enselic)
  • If PAGER is bat, silently use less to prevent recursion. For BAT_PAGER or --pager, exit with error, see #1413 (@Enselic)
  • Manpage highlighting fix, see #1511 (@keith-hall)
  • BAT_CONFIG_PATH ignored by bat 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

New themes

  • ansi replaces ansi-dark and ansi-light, see #1104 and #1412 (@mk12). Breaking change: users that were previously using one of the ansi-* themes should switch to ansi.
  • The Gruvbox theme has been updated, see #1291 (@j0hnmeow). Breaking change: users that were previously using gruvbox or gruvbox-white should update and use gruvbox-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 the git feature is not enabled)