Skip to content

Releases

v0.27.0

Choose a tag to compare

@keith-hall keith-hall released this 28 Nov 07:21
a1a7917

v0.27.0

Features

  • Map .yamllint, .prettierrc and .eslintrc to YAML syntax highlighting, see #4156 (@yusufemreboyraz)
  • Map .clang-tidy to YAML syntax highlighting, see #4150 (@yusufemreboyraz)
  • Automatically build the syntax/theme cache on first run when custom themes or syntaxes are present but no cache exists yet, so newly installed dotfiles work without a manual bat cache --build. Use --no-custom-assets to opt out. Closes #4017, see #4038 (@mmustafasenoglu)
  • Add -b / --number-nonblank flag to only number non-blank lines, for cat -b compatibility. Closes #3856, see #3857 (@MeGaurav4)
  • Add a --sanitize=<auto|always|never> flag for safe display of untrusted input. It substitutes terminal-active control bytes (escape, cursor moves, charset switches, beep, etc.) and Unicode bidi / zero-width formatting characters with the Unicode replacement character (U+FFFD). Mitigates Trojan-Source-style spoofing (CVE-2021-42574). See #3729 (@curious-rabbit)
  • Map justfile, Justfile, .justfile, and *.justfile to Makefile syntax highlighting, see #3623 (@zachvalenta)
  • Map .kube/config to YAML syntax highlighting, see #3911 (@logarithmone1128)
  • Preserve --diff change markers and snip separators when --plain is set. Closes #3630, see #3643 (@mvanhorn)
  • Added support for hidden_file_extensions from .sublime-syntax files, see #3613 (@Matei02355)
  • Add word wrapping mode via --wrap=word, see #3597 (@veeceey)
  • Support configuring --terminal-width via BAT_WIDTH, see #3679 (@officialasishkumar)
  • Implement --unbuffered mode for streaming input, allowing partial lines to display immediately (e.g. tail -f | bat -u). Closes #3555, see #3583 (@mainnebula)
  • Added an initial flake.nix for a ready made development environment; see #3578 (@vorburger)
  • Add --quiet-empty (-E) flag to suppress output when input is empty. Closes #1936, see #3563 (@NORMAL-EX)
  • Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)
  • Add --fallback-syntax/--fallback-language to apply syntax highlighting only when auto-detection fails, see #1341 (@Xavrir)
  • Map BUILD case sensitively to Python (Starlark) for Bazel, see #3576 (@vorburger)
  • Syntax highlighting for Python files using uv as script runner in shebang #3689 (@janlarres)

Bugfixes

  • Track reverse video (SGR 7 / 27) in the ANSI style tracker so it is re-emitted like bold, dim, italic, and underline, and is no longer dropped after the first wrapped line when displaying ANSI input, see #4144 (@BlueX888)
  • Preserve buffered stdin when $LESSOPEN temporary-file mode falls back to the original input, and handle CRLF line endings on returned temp paths, see #4158 (@xgbtxy)
  • Skip cache metadata validation when --no-custom-assets is set so outdated or malformed caches do not block fallback to integrated assets, see #4157 (@xgbtxy)
  • Only show style decorations with --decorations=auto when stdout is interactive, so piped --color=always output no longer includes the header, grid, or line numbers, see #4151 (@draarivpatel-ui)
  • Break --wrap=word lines at whitespace in earlier highlighted tokens or before ANSI escape sequences instead of in the middle of a word, closes #4139, see #4140 (@mansur-akhmadi)
  • Fix bat cache --help returning exit code 1 instead of 0. Remove .arg_required_else_help(true) from the cache subcommand and show help when no arguments are provided. See #3798, #3831 and #3837 (@Amilliox)
  • Fix builtin pager (minus) not responding to search (/, ?, n, N) and navigation (PgUp, PgDown, arrows, g, G) keys. HashedEventRegister was overriding all default minus bindings instead of extending them. Add generate_default_bindings() before custom bindings. See #3831, #3798 and #3837 (@Amilliox)
  • Build the cache automatically on first run when custom themes or syntaxes are in subdirectories, see #4131 (@NotAFlightRisk)
  • Do not run filter commands from the configuration of the Git repository that contains the displayed file, see #4127 (@curious-rabbit)
  • Ignore empty --ignored-suffix values to avoid a stack overflow, see #4122 (@spicysharkco)
  • Fix --number-nonblank counting empty UTF-16 lines, see #4118 (@pcbeingused333)
  • Fix automatic cache build progress polluting stdout, see #4130 (@intertermux-code)
  • Don't emit --highlight-line escape sequences (background color or ansi theme underline) when colors are disabled with --color=never. Closes #4099, see #4100 (@DeviousCardi)
  • Fix missing colors, pager, and decorations in mintty/MSYS2 and Cygwin terminals on Windows, see #4115 (@rezamuliawijaya)
  • Make full-path --map-syntax patterns and the built-in $HOME and $XDG_CONFIG_HOME mappings work on Windows, see #4113 (@b84330808)
  • Keep configuration and BAT_OPTS active for option-like filenames after --, and report invalid configuration for help-like filenames, see #4112 (@Marve10s)
  • Keep emoji sequences together within text chunks when wrapping content, and measure their combined display width, see #4108 (@Marve10s)
  • Preserve full-path syntax mappings when removing ignored filename suffixes, see #4111 (@Marve10s)
  • Fix UTF-16 line splitting at unaligned newline bytes corrupting text and shifting line ranges, see #4110 (@Marve10s)
  • Respect NO_COLOR for the [bat error] and [bat warning] prefixes, see #4048 (@qodelicious)
  • Offer the valid --wrap value auto instead of the rejected always in the PowerShell completion, see #4070 (@ump45nose)
  • Report BAT_CONFIG_DIR in bat --diagnostic, so bug reports show a config directory that overrides $XDG_CONFIG_HOME. See #4068 (@ump45nose)
  • Ignore a UTF-8 byte order mark at the start of the config file instead of treating it as part of the first argument, see #4103 (@jaeminbird)
  • Keep backslashes in the pager command on Windows, so BAT_PAGER=C:\tools\less.exe is found instead of becoming C:toolsless.exe, see #4104 (@jaeminbird)
  • Fix bat hanging forever on JavaScript (and Svelte) code where an expression is followed by a block comment, e.g. a /* x */. Closes #4080, see #4091 (@NavpreetSSidhu)
  • Fix the first line of UTF-16BE input swallowing the second line, which broke line numbers, --line-range and highlighting, see #4102 (@cindykrafft)
  • Exit quietly with status 0 instead of panicking when stdout is closed early (broken pipe) on auxiliary output paths such as --completion, --config-file, --diagnostic, --generate-config-file, --set-terminal-title and cache --build/--clear, matching the main output path since #232, closes #4034, see #4035 (@Mathjk)
  • Fix escape sequence handling in --strip-ansi and --sanitize. --sanitize no longer removes escape sequences, which could hide text, see #4024 (@curious-rabbit)
  • Report unknown languages in plain piped output, see #4001 (@ryanchou1994)
  • Track strikethrough (SGR 9 / 29) in the ANSI style tracker so it is re-emitted like bold, dim, italic, and underline, and is no longer dropped after the first highlighted token when displaying ANSI input with syntax highlighting, see #4015 (@mikehasa)
  • Allow boolean flags to be given more than once, so that a flag set in the config file can also be passed on the command line without erroring, see #3912 (@logarithmone1128)
  • Allow options that take a value (--binary, --italic-text, --nonprintable-notation, --fallback-syntax, --squeeze-limit) to be given more than once, so that a value from the config file can be overridden on the command line, see #4102 (@Huang-404-Q)
  • Use parsed CLI arguments to detect number flags, see #3908 (@cuishuang)
  • Detect binary content beyond the first line, preventing encrypted files with early line breaks from being treated as text. Closes #3554, see #3877 (@Matei02355)
  • Use the last occurrence of numbering and plain flags in combined short arguments, see #3897 (@cuishuang)
  • Avoid a spurious Cargo manifest error during installation from Git, see #3899 (@rootsec1)
  • Avoid repeated scans of long lines in Log syntax highlighting, see #3876 (@Matei02355)
  • Fix --list-languages respecting --paging=never, see #3828 (@cyphercodes)
  • Fix --sanitize passing through the bidi control characters U+200E, U+200F and U+061C, see #3862 (@lenamonj)
  • --strip-ansi: also strip 8-bit C1 introducers (U+0090, U+0098, U+009B, U+009D, U+009E, U+009F) and DCS/SOS/PM/APC sequence bodies, which previously passed through. See #3729 (@curious-rabbit)
  • Fix --ignored-suffix not falling back to first-line/shebang detection when the ignored suffix is also a registered extension (e.g. --ignored-suffix .txt on a shebang script), see #2745 and #3816 (@adnrivera)
  • Fix capacity overflow panic when printing a snip separator at --terminal-width=1 with multiple line ranges. Closes #3803, see #3804 (@leeewee)
  • Pass --no-paging to bat invocations inside the bash / zsh / fish / PowerShell shell completion scripts so that shell-level pager wiring (e.g. LESSOPEN='|-bat -f -pp %s') cannot inject ANSI escape sequences into the completion candidates. Closes #3760 (@mvanhorn)
  • Quote filenames before substituting them into $LESSOPEN / $LESSCLOSE templates, preventing shell injection when a filename contains shell metacharacters, see #3726 (@curious-rabbit)
  • Fix --list-themes unconditionally probing the terminal via OSC 10/11 even when --theme was set to an explicit value, see #3700 (regression introduced in bc42149). (@optimistiCli)
  • Fix inverted $LESSCLOSE warning so bat warns on nonzero exit, not on success. See #3654 (@cuiweixie)
  • Sanitize control characters in filenames before displaying them in the file header, error messages, and the terminal title, preventing ANSI escape injection via crafted filenames. Closes #3054, see #3691 (@curious-rabbit)
  • Report initial input read errors instead of treating them as empty input. Closes #3002, see #3706 (@lawrence3699)...
Read more

v0.26.1

Choose a tag to compare

@keith-hall keith-hall released this 02 Dec 20:48
979ba22

v0.26.1

Features

Bugfixes

  • Fix hang when using --list-themes with an explicit pager, see #3457 (@abhinavcool42)
  • Fix negative values of N not being parsed in <N:M> line ranges without = flag value separator, see #3442 (@lmmx)
  • Fix broken Docker syntax preventing use of custom assets, see #3476 (@keith-hall)
  • Fix decorations being applied unexpectedly when piping. Now only line numbers explicitly required on the command line should be applied in auto decorations mode for cat compatibility. See #3496 (@keith-hall)
  • Fix diagnostics attempting to find the version of an executable named builtin when builtin pager is used. See #3498 (@keith-hall)
  • --help now correctly reads the config file for theme information etc. See #3507 (@keith-hall)

Other

  • Improve README documentation on pager options passed to less, see #3443 (@injust)
  • Make PowerShell completions compatible with PowerShell v5.1, see #3495 (@keith-hall)
  • Use more robust approach to escaping in Bash completions, see #3448 (@akinomyoga)

Syntaxes

  • Update quadlet syntax mapping to include *.{build,pod} files #3484 (@cyqsimon)
  • Fix inconsistencies in Ada syntax, see #3481 (@AldanTanneo)
  • Add syntax mapping for podman's artifact quadlet files, see #3497 (@xduugu)
  • Highlight Korn Shell scripts (i.e. with a shebang of ...ksh) using Bash syntax, see #3509 (@keith-hall)

v0.26.0

Choose a tag to compare

@keith-hall keith-hall released this 19 Oct 18:22
c734087

v0.26.0

Features

Bugfixes

  • Fix UTF-8 BOM not being stripped for syntax detection, see #3314 (@krikera)
  • Fix BAT_THEME_DARK and BAT_THEME_LIGHT being ignored, see issue #3171 and PR #3168 (@bash)
  • Prevent --list-themes from outputting default theme info to stdout when it is piped, see #3189 (@einfachIrgendwer0815)
  • Rename some submodules to fix Dependabot submodule updates, see issue #3198 and PR #3201 (@victor-gp)
  • Make highlight tests fail when new syntaxes don't have fixtures PR #3255 (@dan-hipschman)
  • Fix crash for multibyte characters in file path, see issue #3230 and PR #3245 (@HSM95)
  • Add missing mappings for various bash/zsh files, see PR #3262 (@AdamGaskins)
  • Send all bat errors to stderr by default, see #3336 (@JerryImMouse)
  • Make --map-syntax target case insensitive to match --language, see #3206 (@keith-hall)
  • Correctly determine the end of the line in UTF16LE/BE input #3369 (@keith-hall)
  • --style=changes no longer prints a two-space indent when the file is unmodified, see issue #2710 and PR #3406 (@jyn514)
  • Add missing shell completions, see #3411 (@keith-hall)
  • Execute help/version/diagnostic commands even with invalid config/arguments present, see #3414 (@keith-hall)
  • Fixed line numbers (-n) and style components not printing when piping output, see issue #2935 and PR #3438 (@lmmx)

Other

  • Update base16 README links to community driven base16 work #2871 (@JamyGolden)
  • Work around build failures when building bat from vendored sources #3179 (@dtolnay)
  • CICD: Stop building for x86_64-pc-windows-gnu which fails #3261 (Enselic)
  • CICD: CICD: replace windows-2019 runners with windows-2025 #3339 (@cyqsimon)
  • Build script: replace string-based codegen with quote-based codegen #3340 (@cyqsimon)
  • Improve code coverage of --list-languages parameter #2942 (@sblondon)
  • Only start offload worker thread when there's more than 1 core #2956 (@cyqsimon)
  • Update terminal-colorsaurus (the library used for dark/light detection) to 1.0, see #3347 (@bash)
  • Update console dependency to 0.16, see #3351 (@musicinmybrain)
  • Fixed some typos #3244 (@ssbarnea)
  • Update onig_sys dependency to 69.9.1 to fix a gcc build failure #3400 (@CosmicHorrorDev)
  • Add a cargo feature (vendored-libgit2) to build with vendored libgit2 version without depending on the system's one #3426 (@0x61nas)
  • Update syntect dependency to v5.3.0 to fix a few minor bugs, see #3410 (@keith-hall)

Syntaxes

Themes

v0.25.0

Choose a tag to compare

@keith-hall keith-hall released this 07 Jan 19:08
25f4f96

v0.25.0

Features

Bugfixes

Other

Syntaxes

Themes

  • Patched/improved themes for better Manpage syntax highlighting support, see #2994 (@keith-hall).

bat as a library

  • Changes to syntax_mapping::SyntaxMapping #2755 (@cyqsimon)
    • SyntaxMapping::get_syntax_for is now correctly public
    • [BREAKING] SyntaxMapping::{empty,builtin} are removed; use SyntaxMapping::new instead
    • [BREAKING] SyntaxMapping::mappings is replaced by SyntaxMapping::{builtin,custom,all}_mappings
  • Make Controller::run_with_error_handler's error handler FnMut, see #2831 (@rhysd)
  • Improve compile time by 20%, see #2815 (@dtolnay)
  • Add theme::theme for choosing an appropriate theme based on the
    terminal's color scheme, see #2896 (@bash)
    • [BREAKING] Remove HighlightingAssets::default_theme. Use theme::default_theme instead.
  • Add PrettyPrinter::print_with_writer for custom output destinations, see #3070 (@kojix2)

v0.24.0

Choose a tag to compare

@Enselic Enselic released this 11 Oct 18:20

v0.24.0

Features

Bugfixes

  • Fix more not being found on Windows when provided via BAT_PAGER, see #2570, #2580, and #2651 (@mataha)
  • Switched default behavior of --map-syntax to be case insensitive #2520
  • Updated version of serde_yaml to 0.9. See #2627 (@Raghav-Bell)
  • Fix arithmetic overflow in LineRange::from and LineRange::parse_range, see #2674, #2698 (@skoriop)
  • Fix paging not happening when stdout is interactive but stdin is not, see #2574 (@Nigecat)
  • Make -pp override --paging and vice versa when passed as a later argument, see #2660 (@J-Kappes)

Other

Syntaxes

bat as a library

  • Add optional output_buffer arg to Controller::run() and Controller::run_with_error_handler(), see #2618 (@Piturnah)

v0.23.0

Choose a tag to compare

@sharkdp sharkdp released this 25 Mar 09:33

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

Choose a tag to compare

@Enselic Enselic released this 10 Sep 18:09

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

Choose a tag to compare

@sharkdp sharkdp released this 06 Sep 20:55

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

Choose a tag to compare

@Enselic Enselic released this 12 May 11:39

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

Choose a tag to compare

@Enselic Enselic released this 27 Feb 07:16

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)